Skip to content

Commit

Permalink
feat(eslint): use eslint v9, typescript-eslint v8
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlancollins committed Aug 30, 2024
1 parent 26dc2db commit 7d78079
Show file tree
Hide file tree
Showing 4 changed files with 243 additions and 329 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"cipublishforce": "CI=true pnpm cipublish"
},
"devDependencies": {
"@types/node": "^20.14.10",
"jsdom": "^24.1.3",
"@types/node": "^20.16.2",
"jsdom": "^25.0.0",
"nx": "^19.6.4",
"prettier": "^3.3.3",
"publint": "^0.2.10",
Expand Down
10 changes: 5 additions & 5 deletions packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@
},
"dependencies": {
"@commitlint/parse": "^19.0.3",
"@eslint/js": "^8.57.0",
"@eslint/js": "^9.9.1",
"@stylistic/eslint-plugin-js": "^2.7.1",
"commander": "^12.1.0",
"current-git-branch": "^1.1.0",
"esbuild-register": "^3.6.0",
"eslint-plugin-import-x": "^3.1.0",
"eslint-plugin-import-x": "^4.1.1",
"eslint-plugin-n": "^17.10.2",
"globals": "^15.9.0",
"interpret": "^3.1.1",
Expand All @@ -78,22 +78,22 @@
"typedoc": "^0.26.6",
"typedoc-plugin-frontmatter": "^1.0.0",
"typedoc-plugin-markdown": "^4.2.6",
"typescript-eslint": "^7.18.0",
"typescript-eslint": "^8.3.0",
"v8flags": "^4.0.1",
"vite-plugin-dts": "^4.0.3",
"vite-plugin-externalize-deps": "^0.8.0",
"vite-tsconfig-paths": "^5.0.1"
},
"devDependencies": {
"@types/current-git-branch": "^1.1.6",
"@types/eslint": "^8.56.12",
"@types/eslint": "^9.6.1",
"@types/interpret": "^1.1.3",
"@types/jsonfile": "^6.1.4",
"@types/liftoff": "^4.0.3",
"@types/minimist": "^1.2.5",
"@types/semver": "^7.5.8",
"@types/v8flags": "^3.1.3",
"eslint": "^8.57.0",
"eslint": "^9.9.1",
"type-fest": "^4.26.0"
}
}
16 changes: 9 additions & 7 deletions packages/config/src/eslint/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ export const typescriptRules = {
'ts-ignore': 'allow-with-description',
},
],
/** Bans problematic built-in types and suggests alternatives */
'@typescript-eslint/ban-types': 'error',
/** Enforce import type { T } */
'@typescript-eslint/consistent-type-imports': [
'error',
Expand Down Expand Up @@ -44,6 +42,11 @@ export const typescriptRules = {
'@typescript-eslint/no-extra-non-null-assertion': 'error',
/** There are several potential bugs with this compared to other loops */
'@typescript-eslint/no-for-in-array': 'error',
/** Don't over-define types for simple things like strings */
'@typescript-eslint/no-inferrable-types': [
'error',
{ ignoreParameters: true },
],
/** Enforce valid definition of new and constructor */
'@typescript-eslint/no-misused-new': 'error',
/** Disallow TypeScript namespaces */
Expand All @@ -54,11 +57,10 @@ export const typescriptRules = {
'@typescript-eslint/no-unnecessary-condition': 'error',
/** Checks if the the explicit type is identical to the inferred type */
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
/** Don't over-define types for simple things like strings */
'@typescript-eslint/no-inferrable-types': [
'error',
{ ignoreParameters: true },
],
/** Disallow using the unsafe built-in Function type */
'@typescript-eslint/no-unsafe-function-type': 'error',
/** Disallow using confusing built-in primitive class wrappers */
'@typescript-eslint/no-wrapper-object-types': 'error',
/** Enforce the use of as const over literal type */
'@typescript-eslint/prefer-as-const': 'error',
/** Prefer for-of loop over the standard for loop */
Expand Down
Loading

0 comments on commit 7d78079

Please sign in to comment.