Skip to content

Commit 6c8a54c

Browse files
committed
Add class member visibility as ESLint warning
Also remove unnecessary rules from config.
1 parent 071a1ef commit 6c8a54c

3 files changed

Lines changed: 12 additions & 58 deletions

File tree

eslint.config.mjs

Lines changed: 8 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default defineConfig([
1212
globalIgnores(['src/data/*'], 'Ignore Source Data Directory'),
1313

1414
{
15-
files: ['**/*.js', '**/*.mjs'],
15+
files: ['**/*.js', '**/*.mjs', '**/*.cjs'],
1616
plugins: {
1717
js,
1818
},
@@ -27,7 +27,6 @@ export default defineConfig([
2727
},
2828

2929
ecmaVersion: 'latest',
30-
sourceType: 'module',
3130
},
3231

3332
rules: {
@@ -38,20 +37,16 @@ export default defineConfig([
3837
},
3938
],
4039

41-
'linebreak-style': ['error', 'unix'],
4240
'guard-for-in': 'error',
43-
'max-len': 'off',
4441
'no-var': 'error',
4542
'prefer-const': 'error',
4643
'array-callback-return': 'error',
47-
'no-constant-binary-expression': 'error',
4844
'no-constructor-return': 'error',
4945
'no-duplicate-imports': 'error',
5046
'no-self-compare': 'error',
5147
'no-template-curly-in-string': 'warn',
5248
'no-unmodified-loop-condition': 'warn',
5349
'no-unreachable-loop': 'error',
54-
'no-unused-private-class-members': 'error',
5550

5651
'prefer-arrow-callback': [
5752
'error',
@@ -62,54 +57,16 @@ export default defineConfig([
6257
},
6358
},
6459
{
65-
files: ['**/*.cjs'],
66-
plugins: {
67-
js,
60+
files: ['**/*.js', '**/*.mjs'],
61+
languageOptions: {
62+
sourceType: 'module',
6863
},
69-
70-
extends: ['js/recommended'],
71-
64+
},
65+
{
66+
files: ['**/*.cjs'],
7267
languageOptions: {
73-
globals: {
74-
...globals.node,
75-
...globals.jest,
76-
__VITE_ENV__: 'readonly',
77-
},
78-
79-
ecmaVersion: 'latest',
8068
sourceType: 'commonjs',
8169
},
82-
83-
rules: {
84-
'no-console': [
85-
'error',
86-
{
87-
allow: ['warn'],
88-
},
89-
],
90-
91-
'linebreak-style': ['error', 'unix'],
92-
'guard-for-in': 'error',
93-
'max-len': 'off',
94-
'no-var': 'error',
95-
'prefer-const': 'error',
96-
'array-callback-return': 'error',
97-
'no-constant-binary-expression': 'error',
98-
'no-constructor-return': 'error',
99-
'no-duplicate-imports': 'error',
100-
'no-self-compare': 'error',
101-
'no-template-curly-in-string': 'warn',
102-
'no-unmodified-loop-condition': 'warn',
103-
'no-unreachable-loop': 'error',
104-
'no-unused-private-class-members': 'error',
105-
106-
'prefer-arrow-callback': [
107-
'error',
108-
{
109-
allowUnboundThis: false,
110-
},
111-
],
112-
},
11370
},
11471
{
11572
files: ['**/*.ts'],
@@ -133,21 +90,18 @@ export default defineConfig([
13390
},
13491
],
13592

136-
'linebreak-style': ['error', 'unix'],
13793
'guard-for-in': 'error',
138-
'max-len': 'off',
13994
'no-var': 'error',
14095
'prefer-const': 'error',
14196
'array-callback-return': 'error',
142-
'no-constant-binary-expression': 'error',
14397
'no-constructor-return': 'error',
14498
'no-duplicate-imports': 'error',
14599
'no-self-compare': 'error',
146100
'no-template-curly-in-string': 'warn',
147101
'no-unmodified-loop-condition': 'warn',
148102
'no-unreachable-loop': 'error',
149-
'no-unused-private-class-members': 'error',
150103
'@typescript-eslint/require-await': 'off',
104+
'@typescript-eslint/explicit-member-accessibility': 'warn',
151105

152106
'prefer-arrow-callback': [
153107
'error',

src/schema/loader.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default class HedSchemaLoader extends AbstractHedSchemaLoader {
1818
* @returns The schema XML data.
1919
* @throws {IssueError} If the schema could not be loaded.
2020
*/
21-
override async loadLocalSchema(path: string): Promise<HedSchemaXMLObject> {
21+
protected override async loadLocalSchema(path: string): Promise<HedSchemaXMLObject> {
2222
return this.loadSchemaFile(files.readFile(path), 'localSchemaLoadFailed', { path })
2323
}
2424

@@ -28,7 +28,7 @@ export default class HedSchemaLoader extends AbstractHedSchemaLoader {
2828
* @param schemaDef - The description of which schema to use.
2929
* @returns Whether this validator bundles a particular schema.
3030
*/
31-
override hasBundledSchema(schemaDef: SchemaSpec): boolean {
31+
protected override hasBundledSchema(schemaDef: SchemaSpec): boolean {
3232
return localSchemaMap.has(schemaDef.localName)
3333
}
3434

@@ -38,7 +38,7 @@ export default class HedSchemaLoader extends AbstractHedSchemaLoader {
3838
* @param schemaDef - The description of which schema to use.
3939
* @returns The raw schema XML data.
4040
*/
41-
override async getBundledSchema(schemaDef: SchemaSpec): Promise<string> {
41+
protected override async getBundledSchema(schemaDef: SchemaSpec): Promise<string> {
4242
const schemaXml = localSchemaMap.get(schemaDef.localName)
4343
if (!schemaXml) {
4444
IssueError.generateAndThrowInternalError('Bundled schema could not be found')

src/schema/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export default class SchemaParser {
8484
*
8585
* @param rootElement - The root XML element.
8686
*/
87-
constructor(rootElement: HedSchemaRootElement) {
87+
public constructor(rootElement: HedSchemaRootElement) {
8888
this.rootElement = rootElement
8989
this._versionDefinitions = {
9090
typeProperties: new Set(['boolProperty']),

0 commit comments

Comments
 (0)