Skip to content

Commit 9ffb741

Browse files
committed
Upgrade to eslint 9 and flat configs
1 parent 209f13e commit 9ffb741

25 files changed

+1442
-10599
lines changed

.eslintrc.js

-1
This file was deleted.

package-lock.json

+1,175-10,366
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dev": "turbo run dev --parallel",
77
"test": "turbo run test",
88
"lint": "turbo run lint",
9-
"lint:fix": "eslint . --ext .ts --fix",
9+
"lint:fix": "turbo run lint -- --fix",
1010
"test:watch": "npm run test:watch -w ring-client-api",
1111
"example": "turbo build --filter=ring-client-api && DEBUG=ring node -r @swc-node/register ./packages/examples/example.ts",
1212
"api-example": "turbo build --filter=ring-client-api && DEBUG=ring node -r @swc-node/register ./packages/examples/api-example.ts",
Original file line numberDiff line numberDiff line change
@@ -1,188 +1,205 @@
1-
module.exports = {
2-
parser: '@typescript-eslint/parser',
3-
extends: [
4-
'plugin:@typescript-eslint/recommended',
5-
'plugin:prettier/recommended',
6-
'plugin:deprecation/recommended',
7-
],
8-
ignorePatterns: [
9-
'release-*',
10-
'lib',
11-
'public',
12-
'build',
13-
'json-data',
14-
'.eslintrc.js',
15-
'.turbo/**/*',
16-
],
17-
parserOptions: {
18-
ecmaVersion: 2018,
19-
sourceType: 'module',
20-
project: 'tsconfig.json',
21-
},
22-
env: {
23-
node: true,
24-
es6: true,
25-
es2020: true,
1+
import eslint from '@eslint/js'
2+
import tseslint from 'typescript-eslint'
3+
import parser from '@typescript-eslint/parser'
4+
import prettier from 'eslint-plugin-prettier'
5+
import globals from 'globals'
6+
import prettierRecommended from 'eslint-plugin-prettier/recommended'
7+
import deprecation from 'eslint-plugin-deprecation'
8+
9+
export default tseslint.config(
10+
{
11+
ignores: [
12+
'release-*',
13+
'lib',
14+
'public',
15+
'build',
16+
'json-data',
17+
'.eslintrc.js',
18+
'.turbo',
19+
],
2620
},
27-
rules: {
28-
'comma-dangle': [2, 'only-multiline'],
29-
'no-cond-assign': [2, 'except-parens'],
30-
'no-console': 2,
31-
'no-constant-condition': 2,
32-
'no-control-regex': 0,
33-
'no-debugger': 2,
34-
'no-dupe-keys': 2,
35-
'no-dupe-class-members': 2,
36-
'no-duplicate-imports': 2,
37-
'no-empty': 2,
38-
'no-empty-character-class': 2,
39-
'no-ex-assign': 2,
40-
'no-extra-boolean-cast': 2,
41-
'no-extra-semi': 0,
42-
'no-func-assign': 2,
43-
'no-inner-declarations': 2,
44-
'no-invalid-regexp': 2,
45-
'no-irregular-whitespace': 2,
46-
'no-negated-in-lhs': 2,
47-
'no-obj-calls': 2,
48-
'no-regex-spaces': 2,
49-
'no-reserved-keys': 0,
50-
'no-sparse-arrays': 2,
51-
'no-unreachable': 2,
52-
'use-isnan': 2,
53-
'valid-jsdoc': 0,
54-
'valid-typeof': 2,
55-
'prefer-const': 2,
21+
eslint.configs.recommended,
22+
...tseslint.configs.recommended,
23+
prettierRecommended,
24+
{
25+
files: ['**/*.ts'],
26+
plugins: {
27+
prettier,
28+
deprecation,
29+
},
30+
languageOptions: {
31+
globals: globals.node,
32+
parser: parser,
33+
parserOptions: {
34+
project: './tsconfig.json',
35+
},
36+
},
37+
rules: {
38+
'comma-dangle': [2, 'only-multiline'],
39+
'no-cond-assign': [2, 'except-parens'],
40+
'no-console': 2,
41+
'no-constant-condition': 2,
42+
'no-control-regex': 0,
43+
'no-debugger': 2,
44+
'no-dupe-keys': 2,
45+
'no-dupe-class-members': 2,
46+
'no-duplicate-imports': 2,
47+
'no-empty': 2,
48+
'no-empty-character-class': 2,
49+
'no-ex-assign': 2,
50+
'no-extra-boolean-cast': 2,
51+
'no-extra-semi': 0,
52+
'no-func-assign': 2,
53+
'no-inner-declarations': 2,
54+
'no-invalid-regexp': 2,
55+
'no-irregular-whitespace': 2,
56+
'no-negated-in-lhs': 2,
57+
'no-obj-calls': 2,
58+
'no-regex-spaces': 2,
59+
'no-reserved-keys': 0,
60+
'no-sparse-arrays': 2,
61+
'no-unreachable': 2,
62+
'use-isnan': 2,
63+
'valid-jsdoc': 0,
64+
'valid-typeof': 2,
65+
'prefer-const': 2,
5666

57-
'block-scoped-var': 0,
58-
complexity: 0,
59-
'consistent-return': 0,
60-
curly: [2, 'multi-line'],
61-
'default-case': 0,
62-
'dot-notation': 2,
63-
eqeqeq: 2,
64-
'guard-for-in': 0,
65-
'no-alert': 2,
66-
'no-caller': 2,
67-
'no-div-regex': 2,
68-
'no-else-return': 2,
69-
'no-eq-null': 2,
70-
'no-eval': 2,
71-
'no-extend-native': 2,
72-
'no-extra-bind': 2,
73-
'no-fallthrough': 2,
74-
'no-floating-decimal': 2,
75-
'no-implied-eval': 2,
76-
'no-iterator': 2,
77-
'no-labels': 2,
78-
'no-lone-blocks': 2,
79-
'no-loop-func': 2,
80-
'no-multi-spaces': 2,
81-
'no-multi-str': 0,
82-
'no-native-reassign': 0,
83-
'no-new': 0,
84-
'no-new-func': 2,
85-
'no-new-wrappers': 2,
86-
'no-octal': 0,
87-
'no-octal-escape': 0,
88-
'no-process-env': 0,
89-
'no-proto': 0,
90-
'no-redeclare': 2,
91-
'no-return-assign': 0,
92-
'no-script-url': 2,
93-
'no-self-compare': 2,
94-
'no-sequences': 2,
95-
'no-throw-literal': 2,
96-
'no-unused-expressions': 0,
97-
'no-void': 2,
98-
'no-warning-comments': 2,
99-
'no-with': 2,
100-
radix: 2,
101-
'vars-on-top': 0,
102-
'wrap-iife': 2,
103-
yoda: 0,
67+
'block-scoped-var': 0,
68+
complexity: 0,
69+
'consistent-return': 0,
70+
curly: [2, 'multi-line'],
71+
'default-case': 0,
72+
'dot-notation': 2,
73+
eqeqeq: 2,
74+
'guard-for-in': 0,
75+
'no-alert': 2,
76+
'no-caller': 2,
77+
'no-div-regex': 2,
78+
'no-else-return': 2,
79+
'no-eq-null': 2,
80+
'no-eval': 2,
81+
'no-extend-native': 2,
82+
'no-extra-bind': 2,
83+
'no-fallthrough': 2,
84+
'no-floating-decimal': 2,
85+
'no-implied-eval': 2,
86+
'no-iterator': 2,
87+
'no-labels': 2,
88+
'no-lone-blocks': 2,
89+
'no-loop-func': 2,
90+
'no-multi-spaces': 2,
91+
'no-multi-str': 0,
92+
'no-native-reassign': 0,
93+
'no-new': 0,
94+
'no-new-func': 2,
95+
'no-new-wrappers': 2,
96+
'no-octal': 0,
97+
'no-octal-escape': 0,
98+
'no-process-env': 0,
99+
'no-proto': 0,
100+
'no-redeclare': 2,
101+
'no-return-assign': 0,
102+
'no-script-url': 2,
103+
'no-self-compare': 2,
104+
'no-sequences': 2,
105+
'no-throw-literal': 2,
106+
'no-unused-expressions': 0,
107+
'no-void': 2,
108+
'no-warning-comments': 2,
109+
'no-with': 2,
110+
radix: 2,
111+
'vars-on-top': 0,
112+
'wrap-iife': 2,
113+
yoda: 0,
104114

105-
'no-catch-shadow': 2,
106-
'no-delete-var': 2,
107-
'no-label-var': 2,
108-
'no-shadow': 2,
109-
'no-shadow-restricted-names': 2,
110-
'no-undef': 2,
111-
'no-undef-init': 2,
112-
'no-undefined': 0,
113-
'no-unused-vars': 0,
114-
'no-use-before-define': 2,
115+
'no-catch-shadow': 2,
116+
'no-delete-var': 2,
117+
'no-label-var': 2,
118+
'no-shadow': 2,
119+
'no-shadow-restricted-names': 2,
120+
'no-undef': 2,
121+
'no-undef-init': 2,
122+
'no-undefined': 0,
123+
'no-unused-vars': 0,
124+
'no-use-before-define': 2,
115125

116-
strict: [2, 'never'],
126+
strict: [2, 'never'],
117127

118-
'handle-callback-err': 2,
119-
'no-mixed-requires': 2,
120-
'no-new-require': 2,
121-
'no-path-concat': 2,
122-
'no-process-exit': 0,
123-
'no-restricted-modules': 0,
124-
'no-sync': 0,
128+
'handle-callback-err': 2,
129+
'no-mixed-requires': 2,
130+
'no-new-require': 2,
131+
'no-path-concat': 2,
132+
'no-process-exit': 0,
133+
'no-restricted-modules': 0,
134+
'no-sync': 0,
125135

126-
'brace-style': [2, '1tbs'],
127-
camelcase: 0,
128-
'comma-spacing': [2, { before: false, after: true }],
129-
'comma-style': 2,
130-
'consistent-this': 0,
131-
'eol-last': 2,
132-
'func-names': 0,
133-
'func-style': 0,
134-
'key-spacing': [2, { beforeColon: false, afterColon: true }],
135-
'linebreak-style': [2, 'unix'],
136-
'max-nested-callbacks': [2, 4],
137-
'new-parens': 2,
138-
'no-array-constructor': 2,
139-
'no-inline-comments': 0,
140-
'no-lonely-if': 2,
141-
'no-mixed-spaces-and-tabs': 2,
142-
'no-multiple-empty-lines': [2, { max: 1 }],
143-
'no-nested-ternary': 0,
144-
'no-new-object': 2,
145-
'semi-spacing': [2, { before: false, after: true }],
146-
'no-spaced-func': 0,
147-
'no-ternary': 0,
148-
'no-trailing-spaces': 2,
149-
'no-underscore-dangle': 0,
150-
'one-var': [2, 'consecutive'],
151-
'operator-assignment': [2, 'always'],
152-
'padded-blocks': 0,
153-
'quote-props': 0,
154-
quotes: [2, 'single', 'avoid-escape'],
155-
semi: [2, 'never'],
156-
'sort-vars': 0,
157-
'keyword-spacing': [2, { before: true, after: true }],
158-
'space-before-blocks': [2, 'always'],
159-
'space-before-function-paren': 0,
160-
'object-curly-spacing': [2, 'always'],
161-
'array-bracket-spacing': [2, 'never'],
162-
'computed-property-spacing': [2, 'never'],
163-
'space-in-parens': [2, 'never'],
164-
'space-infix-ops': 2,
165-
'space-unary-ops': [2, { words: true, nonwords: false }],
166-
'spaced-line-comment': 0,
167-
'wrap-regex': 0,
168-
'require-await': 2,
136+
'brace-style': [2, '1tbs'],
137+
camelcase: 0,
138+
'comma-spacing': [2, { before: false, after: true }],
139+
'comma-style': 2,
140+
'consistent-this': 0,
141+
'eol-last': 2,
142+
'func-names': 0,
143+
'func-style': 0,
144+
'key-spacing': [2, { beforeColon: false, afterColon: true }],
145+
'linebreak-style': [2, 'unix'],
146+
'max-nested-callbacks': [2, 4],
147+
'new-parens': 2,
148+
'no-array-constructor': 2,
149+
'no-inline-comments': 0,
150+
'no-lonely-if': 2,
151+
'no-mixed-spaces-and-tabs': 2,
152+
'no-multiple-empty-lines': [2, { max: 1 }],
153+
'no-nested-ternary': 0,
154+
'no-new-object': 2,
155+
'semi-spacing': [2, { before: false, after: true }],
156+
'no-spaced-func': 0,
157+
'no-ternary': 0,
158+
'no-trailing-spaces': 2,
159+
'no-underscore-dangle': 0,
160+
'one-var': [2, 'consecutive'],
161+
'operator-assignment': [2, 'always'],
162+
'padded-blocks': 0,
163+
'quote-props': 0,
164+
quotes: [2, 'single', 'avoid-escape'],
165+
semi: [2, 'never'],
166+
'sort-vars': 0,
167+
'keyword-spacing': [2, { before: true, after: true }],
168+
'space-before-blocks': [2, 'always'],
169+
'space-before-function-paren': 0,
170+
'object-curly-spacing': [2, 'always'],
171+
'array-bracket-spacing': [2, 'never'],
172+
'computed-property-spacing': [2, 'never'],
173+
'space-in-parens': [2, 'never'],
174+
'space-infix-ops': 2,
175+
'space-unary-ops': [2, { words: true, nonwords: false }],
176+
'spaced-line-comment': 0,
177+
'wrap-regex': 0,
178+
'require-await': 2,
169179

170-
'no-var': 0,
171-
'generator-star': 0,
180+
'no-var': 0,
181+
'generator-star': 0,
172182

173-
'prettier/prettier': ['error'],
174-
'@typescript-eslint/camelcase': 0,
175-
'@typescript-eslint/explicit-function-return-type': 0,
176-
'@typescript-eslint/no-explicit-any': 0,
177-
'@typescript-eslint/no-empty-interface': 0,
178-
'@typescript-eslint/no-floating-promises': 2,
179-
'@typescript-eslint/no-parameter-properties': 0,
180-
'@typescript-eslint/explicit-member-accessibility': 0,
181-
'@typescript-eslint/no-use-before-define': 0,
182-
'@typescript-eslint/no-non-null-assertion': 0,
183-
'@typescript-eslint/no-object-literal-type-assertion': 0,
184-
'@typescript-eslint/no-var-requires': 0,
185-
'@typescript-eslint/explicit-module-boundary-types': 0,
186-
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
183+
'prettier/prettier': ['error'],
184+
'@typescript-eslint/camelcase': 0,
185+
'@typescript-eslint/explicit-function-return-type': 0,
186+
'@typescript-eslint/no-explicit-any': 0,
187+
'@typescript-eslint/no-empty-interface': 0,
188+
'@typescript-eslint/no-floating-promises': 2,
189+
'@typescript-eslint/no-parameter-properties': 0,
190+
'@typescript-eslint/explicit-member-accessibility': 0,
191+
'@typescript-eslint/no-use-before-define': 0,
192+
'@typescript-eslint/no-duplicate-enum-values': 0,
193+
'@typescript-eslint/no-non-null-assertion': 0,
194+
'@typescript-eslint/no-object-literal-type-assertion': 0,
195+
'@typescript-eslint/no-var-requires': 0,
196+
'@typescript-eslint/explicit-module-boundary-types': 0,
197+
'@typescript-eslint/no-unused-vars': 0,
198+
// '@typescript-eslint/no-unused-vars': [
199+
// 'error',
200+
// { argsIgnorePattern: '^_' },
201+
// ],
202+
'deprecation/deprecation': 2,
203+
},
187204
},
188-
}
205+
)

0 commit comments

Comments
 (0)