Skip to content

Commit

Permalink
chore: Update to eslint 9, fix found issues
Browse files Browse the repository at this point in the history
  • Loading branch information
eemeli committed Sep 3, 2024
1 parent e883065 commit adef9c5
Show file tree
Hide file tree
Showing 13 changed files with 318 additions and 405 deletions.
9 changes: 0 additions & 9 deletions .eslintignore

This file was deleted.

57 changes: 0 additions & 57 deletions .eslintrc.yaml

This file was deleted.

1 change: 0 additions & 1 deletion config/rollup.node-config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { chmod, stat } from 'node:fs/promises'
import typescript from '@rollup/plugin-typescript'

export default [
Expand Down
68 changes: 68 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import eslint from '@eslint/js'
import prettierConfig from 'eslint-config-prettier'
import typescript from 'typescript-eslint'

export default [
{
ignores: [
'browser/',
'dist/',
'docs/',
'docs-slate/',
'lib/',
'package-lock.json',
'playground/dist/',
'tests/artifacts/',
'tests/json-test-suite/',
'tests/yaml-test-suite/'
]
},
eslint.configs.recommended,
...typescript.configs.recommended,
prettierConfig,
{
languageOptions: {
parserOptions: {
projectService: {
allowDefaultProject: ['*js', 'config/*js'],
defaultProject: 'tsconfig.json'
}
}
},

rules: {
'array-callback-return': 'error',
camelcase: 'error',
eqeqeq: ['error', 'always', { null: 'ignore' }],
'no-constant-condition': ['error', { checkLoops: false }],
'no-control-regex': 'off',
'no-fallthrough': ['error', { commentPattern: 'fallthrough' }],
'no-implicit-globals': 'error',
'no-template-curly-in-string': 'warn',
'no-var': 'error',
'prefer-const': ['warn', { destructuring: 'all' }],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_' }
],
'@typescript-eslint/prefer-includes': 'warn',
'@typescript-eslint/prefer-nullish-coalescing': [
'warn',
{ ignoreMixedLogicalExpressions: true }
],
'@typescript-eslint/prefer-optional-chain': 'warn'
}
},

{
files: ['config/**'],
languageOptions: { globals: { console: true, module: true, process: true } }
},

{
files: ['tests/**'],
rules: { camelcase: 0 }
}
]
Loading

0 comments on commit adef9c5

Please sign in to comment.