@@ -15,62 +15,52 @@ module.exports = defineConfig({
1515 reportUnusedDisableDirectives : true ,
1616 extends : [
1717 'eslint:recommended' ,
18- 'plugin:@typescript-eslint/recommended' ,
1918 'plugin:@typescript-eslint/recommended-type-checked' ,
2019 'plugin:prettier/recommended' ,
20+ 'plugin:deprecation/recommended' ,
2121 'plugin:jsdoc/recommended-typescript-error' ,
2222 'plugin:unicorn/recommended' ,
2323 ] ,
24- parser : '@typescript-eslint/parser' ,
2524 parserOptions : {
2625 project : [ './tsconfig.json' ] ,
27- sourceType : 'module' ,
2826 warnOnUnsupportedTypeScriptVersion : false ,
2927 } ,
30- plugins : [ '@typescript-eslint' , 'prettier' , 'deprecation' , 'jsdoc' ] ,
3128 rules : {
3229 eqeqeq : [ 'error' , 'always' , { null : 'ignore' } ] ,
3330 'no-else-return' : 'error' ,
34- 'prefer-template' : 'error' ,
3531 'no-restricted-globals' : [ 'error' , 'Intl' ] ,
36-
37- 'deprecation/deprecation' : 'error' ,
32+ 'prefer-template' : 'error' ,
3833
3934 'unicorn/no-nested-ternary' : 'off' , // incompatible with prettier
4035 'unicorn/no-null' : 'off' , // incompatible with TypeScript
36+ 'unicorn/no-zero-fractions' : 'off' , // deactivated to raise awareness of floating operations
4137 'unicorn/number-literal-case' : 'off' , // incompatible with prettier
38+ 'unicorn/prefer-ternary' : 'off' , // ternaries aren't always better
4239
4340 // TODO @Shinigami 92 2023-09-23: prefer-at should be turned on when we drop support for Node 14.
4441 'unicorn/prefer-at' : 'off' ,
4542 // TODO @Shinigami 92 2023-09-23: prefer-string-replace-all should be turned on when we drop support for Node 14.
4643 'unicorn/prefer-string-replace-all' : 'off' ,
44+ // TODO @ST -DDT 2023-10-28: The following rule should be turned on when we switch to esm.
45+ 'unicorn/prefer-top-level-await' : 'off' ,
4746
4847 // TODO @Shinigami 92 2023-09-23: The following rules currently conflict with our code.
4948 // Each rule should be checked whether it should be enabled/configured and the problems fixed, or stay disabled permanently.
5049 'unicorn/better-regex' : 'off' ,
5150 'unicorn/consistent-function-scoping' : 'off' ,
52- 'unicorn/filename-case' : 'off' ,
5351 'unicorn/import-style' : 'off' ,
5452 'unicorn/no-array-callback-reference' : 'off' ,
5553 'unicorn/no-array-reduce' : 'off' ,
5654 'unicorn/no-await-expression-member' : 'off' ,
57- 'unicorn/no-for-loop' : 'off' ,
5855 'unicorn/no-negated-condition' : 'off' ,
5956 'unicorn/no-object-as-default-parameter' : 'off' ,
6057 'unicorn/no-useless-switch-case' : 'off' ,
61- 'unicorn/no-zero-fractions' : 'off' ,
6258 'unicorn/numeric-separators-style' : 'off' ,
63- 'unicorn/prefer-array-some' : 'off' ,
6459 'unicorn/prefer-code-point' : 'off' ,
6560 'unicorn/prefer-export-from' : 'off' ,
6661 'unicorn/prefer-module' : 'off' ,
67- 'unicorn/prefer-native-coercion-functions' : 'off' ,
6862 'unicorn/prefer-negative-index' : 'off' ,
69- 'unicorn/prefer-number-properties' : 'off' ,
70- 'unicorn/prefer-optional-catch-binding' : 'off' ,
7163 'unicorn/prefer-string-slice' : 'off' ,
72- 'unicorn/prefer-ternary' : 'off' ,
73- 'unicorn/prefer-top-level-await' : 'off' ,
7464 'unicorn/prevent-abbreviations' : 'off' ,
7565 'unicorn/require-array-join-separator' : 'off' ,
7666 'unicorn/switch-case-braces' : 'off' ,
@@ -101,11 +91,9 @@ module.exports = defineConfig({
10191 'error' ,
10292 { ignoreParameters : true } ,
10393 ] ,
104- '@typescript-eslint/no-unsafe-argument' : 'error' ,
10594 '@typescript-eslint/no-unsafe-assignment' : 'off' ,
10695 '@typescript-eslint/no-unsafe-call' : 'off' ,
10796 '@typescript-eslint/no-unsafe-member-access' : 'off' ,
108- '@typescript-eslint/no-unsafe-return' : 'error' ,
10997 '@typescript-eslint/padding-line-between-statements' : [
11098 'error' ,
11199 { blankLine : 'always' , prev : 'block-like' , next : '*' } ,
@@ -117,8 +105,7 @@ module.exports = defineConfig({
117105 ] ,
118106 '@typescript-eslint/unbound-method' : 'off' ,
119107
120- 'jsdoc/no-types' : 'error' ,
121- 'jsdoc/require-jsdoc' : 'off' ,
108+ 'jsdoc/require-jsdoc' : 'off' , // Enabled only for src/**/*.ts
122109 'jsdoc/require-returns' : 'off' ,
123110 'jsdoc/sort-tags' : [
124111 'error' ,
@@ -152,8 +139,26 @@ module.exports = defineConfig({
152139 } ,
153140 } ,
154141 {
155- files : [ 'src/locales /**/*.ts' ] ,
142+ files : [ 'src/locale /**/*.ts' ] ,
156143 rules : {
144+ 'unicorn/filename-case' : 'off' , // our locale files have a custom naming scheme
145+ } ,
146+ } ,
147+ {
148+ files : [ 'src/definitions/**/*.ts' , 'src/locales/**/*.ts' ] ,
149+ rules : {
150+ 'unicorn/filename-case' : [
151+ 'error' ,
152+ {
153+ case : 'snakeCase' ,
154+ // TODO @ST -DDT 2023-10-21: rename the definitions in v9
155+ ignore : [
156+ / c h e m i c a l E l e m e n t \. t s $ / ,
157+ / d i r e c t o r y P a t h s \. t s $ / ,
158+ / m i m e T y p e s \. t s $ / ,
159+ ] ,
160+ } ,
161+ ] ,
157162 'unicorn/text-encoding-identifier-case' : 'off' ,
158163 } ,
159164 } ,
0 commit comments