Skip to content

Commit 8630dbe

Browse files
committed
ESLint: update peers in advance of v9 upgrade
1 parent 5814cec commit 8630dbe

File tree

6 files changed

+597
-757
lines changed

6 files changed

+597
-757
lines changed

package.json

+15-16
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,33 @@
1919
"_prettier": "prettier \"**/*.{js,cjs,ts,json,yaml,md}\"",
2020
"_eslint": "eslint \".*.cjs\" \"**/*.{js,cjs,ts}\""
2121
},
22-
"packageManager": "pnpm@9.4.0+sha256.b6fd0bfda555e7e584ad7e56b30c68b01d5a04f9ee93989f4b93ca8473c49c74",
22+
"packageManager": "pnpm@9.12.3+sha256.24235772cc4ac82a62627cd47f834c72667a2ce87799a846ec4e8e555e2d4b8b",
2323
"dependencies": {
2424
"@viamrobotics/eslint-config": "workspace:*",
2525
"@viamrobotics/prettier-config": "workspace:*",
2626
"@viamrobotics/typescript-config": "workspace:*"
2727
},
2828
"devDependencies": {
29-
"@types/node": "^20.14.10",
29+
"@types/node": "^22.9.0",
3030
"@types/semver": "^7.5.8",
31-
"@typescript-eslint/eslint-plugin": "^7.16.0",
32-
"@typescript-eslint/parser": "^7.16.0",
33-
"concurrently": "^8.2.2",
31+
"@typescript-eslint/eslint-plugin": "^8.13.0",
32+
"@typescript-eslint/parser": "^8.13.0",
33+
"concurrently": "^9.1.0",
3434
"eslint": "^8.57.0",
3535
"eslint-config-prettier": "^9.1.0",
3636
"eslint-plugin-jest-dom": "^5.4.0",
3737
"eslint-plugin-simple-import-sort": "^12.1.1",
38-
"eslint-plugin-sonarjs": "^1.0.3",
39-
"eslint-plugin-svelte": "^2.41.0",
40-
"eslint-plugin-tailwindcss": "^3.17.4",
41-
"eslint-plugin-testing-library": "^6.2.2",
42-
"eslint-plugin-unicorn": "^54.0.0",
38+
"eslint-plugin-svelte": "^2.46.0",
39+
"eslint-plugin-tailwindcss": "^3.17.5",
40+
"eslint-plugin-testing-library": "^6.4.0",
41+
"eslint-plugin-unicorn": "^56.0.0",
4342
"eslint-plugin-vitest": "^0.5.4",
44-
"prettier": "^3.3.2",
45-
"prettier-plugin-svelte": "^3.2.5",
46-
"prettier-plugin-tailwindcss": "^0.6.5",
47-
"semver": "^7.6.2",
48-
"typescript": "^5.5.3",
49-
"vitest": "^2.0.1"
43+
"prettier": "^3.3.3",
44+
"prettier-plugin-svelte": "^3.2.7",
45+
"prettier-plugin-tailwindcss": "^0.6.8",
46+
"semver": "^7.6.3",
47+
"typescript": "^5.6.3",
48+
"vitest": "^2.1.4"
5049
},
5150
"pnpm": {
5251
"peerDependencyRules": {

packages/eslint-config/README.md

-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ pnpm add --save-dev \
1616
@typescript-eslint/eslint-plugin \
1717
eslint \
1818
eslint-config-prettier \
19-
eslint-plugin-sonarjs \
2019
eslint-plugin-unicorn \
2120
eslint-plugin-vitest
2221
```
@@ -46,7 +45,6 @@ pnpm add --save-dev \
4645
eslint \
4746
eslint-config-prettier \
4847
eslint-plugin-jest-dom \
49-
eslint-plugin-sonarjs \
5048
eslint-plugin-svelte \
5149
eslint-plugin-tailwindcss \
5250
eslint-plugin-testing-library \

packages/eslint-config/base.cjs

+18-21
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ module.exports = {
88
'plugin:@typescript-eslint/strict-type-checked',
99
'plugin:@typescript-eslint/stylistic-type-checked',
1010
'plugin:unicorn/recommended',
11-
'plugin:sonarjs/recommended-legacy',
1211
'prettier',
1312
],
1413
parserOptions: {
@@ -105,7 +104,7 @@ module.exports = {
105104
'no-template-curly-in-string': 'error',
106105
'no-unneeded-ternary': 'error',
107106
'no-unreachable-loop': 'error',
108-
'no-underscore-dangle': ['error', { allow: ['__VERSION__'] }],
107+
'no-underscore-dangle': ['error', { allow: ['__VERSION__', '_errors'] }],
109108
'no-unmodified-loop-condition': 'error',
110109
'no-unused-expressions': 'error',
111110
'no-unused-private-class-members': 'error',
@@ -122,13 +121,6 @@ module.exports = {
122121
'padding-line-between-statements': 'error',
123122
'prefer-arrow-callback': 'error',
124123
'prefer-const': 'error',
125-
'prefer-destructuring': [
126-
'error',
127-
{
128-
AssignmentExpression: { object: false, array: false },
129-
VariableDeclarator: { object: true, array: true },
130-
},
131-
],
132124
'prefer-exponentiation-operator': 'error',
133125
'prefer-named-capture-group': 'error',
134126
'prefer-numeric-literals': 'error',
@@ -154,6 +146,7 @@ module.exports = {
154146
'error',
155147
{ ignoreArrowShorthand: true },
156148
],
149+
'@typescript-eslint/no-import-type-side-effects': ['error'],
157150
'@typescript-eslint/no-shadow': ['error'],
158151
'@typescript-eslint/no-unused-vars': [
159152
'warn',
@@ -170,6 +163,17 @@ module.exports = {
170163
},
171164
],
172165
'@typescript-eslint/promise-function-async': 'error',
166+
'@typescript-eslint/restrict-template-expressions': [
167+
'error',
168+
{
169+
allowAny: false,
170+
allowBoolean: true,
171+
allowNever: false,
172+
allowNullish: false,
173+
allowNumber: true,
174+
allowRegExp: false,
175+
},
176+
],
173177

174178
// Import sorting
175179
'simple-import-sort/imports': [
@@ -193,11 +197,7 @@ module.exports = {
193197
],
194198
'simple-import-sort/exports': 'error',
195199

196-
// Extra SonarJS rules
197-
'sonarjs/cognitive-complexity': ['error', 20],
198-
199200
// Extra Unicorn rules
200-
'unicorn/consistent-destructuring': 'off',
201201
'unicorn/custom-error-definition': 'error',
202202
'unicorn/no-null': 'off',
203203
'unicorn/no-unused-properties': 'error',
@@ -217,24 +217,21 @@ module.exports = {
217217
commonjs: true,
218218
},
219219
rules: {
220+
'@typescript-eslint/no-require-imports': 'off',
221+
'@typescript-eslint/no-unsafe-member-access': 'off',
222+
'@typescript-eslint/no-unsafe-call': 'off',
223+
'@typescript-eslint/no-unsafe-assignment': 'off',
220224
'@typescript-eslint/no-var-requires': 'off',
221225
},
222226
},
223-
// __dirname and __filename are allowed in vite.config.ts
224-
{
225-
files: ['**/vite.config.ts', '**/vitest.config.ts'],
226-
rules: {
227-
'unicorn/prefer-module': 'off',
228-
},
229-
},
230227
// Rules for tests
231228
{
232229
files: ['**/__tests__/**', '**/*.test.ts', '**/*.spec.ts'],
233230
extends: ['plugin:vitest/legacy-recommended'],
234231
rules: {
235232
'@typescript-eslint/no-non-null-assertion': 'off',
236233
'@typescript-eslint/no-unsafe-assignment': 'off',
237-
'sonarjs/no-duplicate-string': 'off',
234+
'@typescript-eslint/restrict-template-expressions': 'off',
238235
'unicorn/consistent-function-scoping': 'off',
239236
'vitest/consistent-test-filename': [
240237
'error',

packages/eslint-config/package.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publishConfig": {
44
"access": "public"
55
},
6-
"version": "0.6.1",
6+
"version": "0.7.0",
77
"description": "Common ESLint configuration for Viam projects.",
88
"files": [
99
"**/*",
@@ -41,17 +41,16 @@
4141
],
4242
"license": "Apache-2.0",
4343
"peerDependencies": {
44-
"@typescript-eslint/eslint-plugin": ">=6 <8",
45-
"@typescript-eslint/parser": ">=6 <8",
44+
"@typescript-eslint/eslint-plugin": ">=6 <9",
45+
"@typescript-eslint/parser": ">=6 <9",
4646
"eslint": ">=8 <9",
4747
"eslint-config-prettier": ">=9 <10",
4848
"eslint-plugin-jest-dom": ">=5 <6",
4949
"eslint-plugin-simple-import-sort": ">=12 <13",
50-
"eslint-plugin-sonarjs": ">=1 <2",
5150
"eslint-plugin-svelte": ">=2 <3",
5251
"eslint-plugin-tailwindcss": ">=3 <4",
5352
"eslint-plugin-testing-library": ">=6 <7",
54-
"eslint-plugin-unicorn": ">=47 <55",
53+
"eslint-plugin-unicorn": ">=47 <57",
5554
"eslint-plugin-vitest": ">=0.5 <0.6"
5655
},
5756
"peerDependenciesMeta": {

packages/eslint-config/svelte.cjs

-6
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ module.exports = {
2929
parser: '@typescript-eslint/parser',
3030
},
3131
rules: {
32-
/*
33-
* TODO(mc, 2023-08-28): this rule is crashing with svelte actions.
34-
* https://github.com/sveltejs/eslint-plugin-svelte/issues/583
35-
*/
36-
'sonarjs/no-unused-collection': 'off',
37-
3832
// Allows us to set option props to `undefined` by default
3933
'no-undef-init': 'off',
4034
},

0 commit comments

Comments
 (0)