Skip to content

Commit 2127cdf

Browse files
chore: Update to eslint 9
1 parent dd6dade commit 2127cdf

File tree

12 files changed

+561
-590
lines changed

12 files changed

+561
-590
lines changed

.eslintignore

Lines changed: 0 additions & 21 deletions
This file was deleted.

.eslintrc.yaml

Lines changed: 0 additions & 50 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
import js from '@eslint/js';
2+
import eslintConfigPrettier from 'eslint-config-prettier';
3+
import globals from 'globals';
4+
5+
import tseslint from 'typescript-eslint';
6+
7+
export default [
8+
{
9+
ignores: [
10+
'**/dist/',
11+
'**/node_modules/',
12+
'**/package.json',
13+
'**/package-lock.json',
14+
'coverage/',
15+
'docs/',
16+
'mf1/examples/cli/*.mjs',
17+
'mf1/examples/react/',
18+
'mf1/packages/core/lib/*',
19+
'mf1/packages/core/messageformat.*',
20+
'mf1/packages/date-skeleton/lib/*',
21+
'mf1/packages/number-skeleton/lib/*',
22+
'mf1/packages/parser/lib/*',
23+
'mf1/packages/react/lib/*',
24+
'mf1/packages/react/src/__fixtures__/*',
25+
'mf1/packages/rollup-plugin/lib/*',
26+
'mf1/packages/runtime/esm/*',
27+
'mf1/packages/runtime/lib/*',
28+
'mf2/*/lib/*',
29+
'test/messageformat-wg/',
30+
'tmp/'
31+
]
32+
},
33+
js.configs.recommended,
34+
...tseslint.configs.recommended,
35+
eslintConfigPrettier,
36+
{
37+
languageOptions: {
38+
globals: { ...globals.node },
39+
ecmaVersion: 2018,
40+
sourceType: 'module'
41+
},
42+
43+
rules: {
44+
'array-callback-return': 'error',
45+
camelcase: 'off',
46+
'consistent-return': 'error',
47+
curly: ['warn', 'multi-line', 'consistent'],
48+
eqeqeq: ['error', 'smart'],
49+
'no-constant-condition': ['error', { checkLoops: false }],
50+
'no-implicit-globals': 'error',
51+
'no-useless-rename': 'error',
52+
'prefer-const': ['error', { destructuring: 'all' }],
53+
'sort-imports': ['warn', { ignoreDeclarationSort: true }]
54+
}
55+
},
56+
{
57+
files: ['**/*.js'],
58+
rules: {
59+
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
60+
'@typescript-eslint/no-require-imports': 'off'
61+
}
62+
},
63+
{
64+
files: ['**/*.{ts,tsx}'],
65+
rules: {
66+
'no-unused-vars': 'off',
67+
'@typescript-eslint/explicit-module-boundary-types': 'off',
68+
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }]
69+
}
70+
},
71+
{
72+
files: ['test/browser/tests/*.js'],
73+
languageOptions: { globals: { ...globals.mocha } }
74+
},
75+
{
76+
files: ['**/*.test.{mts,ts,tsx}', 'test/**/*.ts'],
77+
rules: {
78+
'@typescript-eslint/ban-ts-comment': 'off',
79+
'@typescript-eslint/no-explicit-any': 'off'
80+
}
81+
}
82+
];

mf1/examples/webpack/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-env browser */
1+
/* global document */
22

33
import messages from './messages.yaml';
44

mf1/packages/cli/lib/options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = function getOptions() {
2020
cfg = YAML.parse(src);
2121
}
2222
break;
23-
} catch (e) {
23+
} catch {
2424
/* ignore errors */
2525
}
2626
}

mf1/packages/number-skeleton/src/numberformat/options.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,6 @@ const tests: { [K in keyof Skeleton]: { [name: string]: TestCase } } = {
222222
},
223223
'sign-except-zero': {
224224
skeleton: { sign: 'sign-except-zero' },
225-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
226-
// @ts-ignore https://github.com/microsoft/TypeScript/issues/46712
227225
result: { signDisplay: 'exceptZero' }
228226
},
229227
'sign-never': {
@@ -240,8 +238,6 @@ const tests: { [K in keyof Skeleton]: { [name: string]: TestCase } } = {
240238
},
241239
'sign-accounting-except-zero': {
242240
skeleton: { sign: 'sign-accounting-except-zero' },
243-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
244-
// @ts-ignore https://github.com/microsoft/TypeScript/issues/46712
245241
result: { currencySign: 'accounting', signDisplay: 'exceptZero' }
246242
}
247243
},

mf1/packages/rollup-plugin/src/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// eslint-disable-next-line @typescript-eslint/no-var-requires
1+
// eslint-disable-next-line @typescript-eslint/no-require-imports
22
jest.mock('fs', () => require('memfs').fs);
33

44
import { fs } from 'memfs';

mf1/packages/runtime/src/fmt/time.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export function time(
2929
minute: 'numeric',
3030
hour: 'numeric'
3131
};
32-
/* eslint-disable no-fallthrough */
3332
switch (size) {
3433
case 'full':
3534
case 'long':

mf2/fluent/src/fluent.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-non-null-assertion */
2-
31
/**
42
* The test cases included in this file have been extracted from the
53
* @fluent/bundle 0.16.1 test files available at:

0 commit comments

Comments
 (0)