Skip to content

Commit

Permalink
Merge pull request #424 from dcastil/renovate/major-eslint-monorepo
Browse files Browse the repository at this point in the history
Update dependency eslint to v9
  • Loading branch information
dcastil authored Oct 3, 2024
2 parents 9ec6338 + 76a54fc commit 0a98923
Show file tree
Hide file tree
Showing 4 changed files with 331 additions and 288 deletions.
172 changes: 0 additions & 172 deletions .eslintrc.json

This file was deleted.

181 changes: 181 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
import vitestPlugin from '@vitest/eslint-plugin'
import importPlugin from 'eslint-plugin-import'
import typescriptPlugin from 'typescript-eslint'

export default typescriptPlugin.config(
{
ignores: ['coverage/**/*', 'dist/**/*', 'node_modules/**/*'],
},
{
files: ['**/*.?(m|c)@(t|j)s'],
},
typescriptPlugin.configs.base,
importPlugin.configs.typescript,
vitestPlugin.configs.recommended,
{
plugins: {
import: importPlugin,
},

rules: {
'@typescript-eslint/consistent-type-assertions': 'warn',
'@typescript-eslint/no-array-constructor': 'warn',
'@typescript-eslint/no-redeclare': 'warn',
'@typescript-eslint/no-unused-expressions': [
'error',
{
allowShortCircuit: true,
allowTaggedTemplates: true,
allowTernary: true,
},
],
'@typescript-eslint/no-unused-vars': [
'warn',
{
args: 'none',
ignoreRestSiblings: true,
},
],
'@typescript-eslint/no-use-before-define': [
'warn',
{
classes: false,
functions: false,
typedefs: false,
variables: false,
},
],
'@typescript-eslint/no-useless-constructor': 'warn',
'array-callback-return': 'warn',
'dot-location': ['warn', 'property'],
eqeqeq: ['warn', 'smart'],
'getter-return': 'warn',
'import/first': 'error',
'import/no-default-export': 'warn',
'import/no-named-as-default': 'warn',
'import/no-named-as-default-member': 'warn',
'import/no-duplicates': 'warn',
'import/order': [
'warn',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'always',
},
],
'new-parens': 'warn',
'no-caller': 'warn',
'no-cond-assign': ['warn', 'except-parens'],
'no-console': 'warn',
'no-const-assign': 'warn',
'no-control-regex': 'warn',
'no-delete-var': 'warn',
'no-dupe-args': 'warn',
'no-dupe-keys': 'warn',
'no-duplicate-case': 'warn',
'no-empty-character-class': 'warn',
'no-empty-pattern': 'warn',
'no-eval': 'warn',
'no-ex-assign': 'warn',
'no-extend-native': 'warn',
'no-extra-bind': 'warn',
'no-extra-label': 'warn',
'no-fallthrough': 'warn',
'no-func-assign': 'warn',
'no-implied-eval': 'warn',
'no-invalid-regexp': 'warn',
'no-iterator': 'warn',
'no-label-var': 'warn',
'no-labels': [
'warn',
{
allowLoop: true,
allowSwitch: false,
},
],
'no-lone-blocks': 'warn',
'no-loop-func': 'warn',
'no-mixed-operators': [
'warn',
{
allowSamePrecedence: false,

groups: [
['&', '|', '^', '~', '<<', '>>', '>>>'],
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
['&&', '||'],
['in', 'instanceof'],
],
},
],
'no-multi-str': 'warn',
'no-native-reassign': 'warn',
'no-negated-in-lhs': 'warn',
'no-new-func': 'warn',
'no-new-object': 'warn',
'no-new-symbol': 'warn',
'no-new-wrappers': 'warn',
'no-obj-calls': 'warn',
'no-octal': 'warn',
'no-octal-escape': 'warn',
'no-regex-spaces': 'warn',
'no-restricted-properties': [
'error',
{
message:
'Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting',
object: 'require',
property: 'ensure',
},
{
message:
'Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting',
object: 'System',
property: 'import',
},
],
'no-restricted-syntax': ['warn', 'WithStatement'],
'no-script-url': 'warn',
'no-self-assign': 'warn',
'no-self-compare': 'warn',
'no-sequences': 'warn',
'no-shadow-restricted-names': 'warn',
'no-sparse-arrays': 'warn',
'no-template-curly-in-string': 'warn',
'no-this-before-super': 'warn',
'no-throw-literal': 'warn',
'no-unreachable': 'warn',
'no-unused-labels': 'warn',
'no-useless-computed-key': 'warn',
'no-useless-concat': 'warn',
'no-useless-escape': 'warn',
'no-useless-rename': [
'warn',
{
ignoreDestructuring: false,
ignoreExport: false,
ignoreImport: false,
},
],
'no-whitespace-before-property': 'warn',
'no-with': 'warn',
'require-yield': 'warn',
'rest-spread-spacing': ['warn', 'never'],
strict: ['warn', 'never'],
'unicode-bom': ['warn', 'never'],
'use-isnan': 'warn',
'valid-typeof': 'warn',
},
},
{
files: ['*.config.?(m|c)@(t|j)s', 'scripts/**/*.config.?(m|c)@(t|j)s'],
rules: {
'import/no-default-export': 'off',
},
},
{
files: ['scripts/**/*.?(m|c)@(t|j)s'],
rules: {
'no-console': 'off',
},
},
)
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,20 @@
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-typescript": "^12.1.0",
"@typescript-eslint/eslint-plugin": "^8.8.0",
"@typescript-eslint/parser": "^8.8.0",
"@vitest/coverage-v8": "^2.1.1",
"@vitest/eslint-plugin": "^1.1.5",
"babel-plugin-annotate-pure-calls": "^0.4.0",
"babel-plugin-polyfill-regenerator": "^0.6.2",
"eslint": "^8.57.1",
"eslint-plugin-import": "^2.30.0",
"eslint": "^9.11.1",
"eslint-plugin-import": "^2.31.0",
"globby": "^11.1.0",
"prettier": "^3.3.3",
"rollup": "^4.22.5",
"rollup-plugin-delete": "^2.1.0",
"rollup-plugin-dts": "^6.1.1",
"tslib": "^2.7.0",
"typescript": "^5.6.2",
"typescript-eslint": "^8.8.0",
"vitest": "^2.1.1",
"zx": "^8.1.8"
},
Expand Down
Loading

0 comments on commit 0a98923

Please sign in to comment.