Skip to content

Commit

Permalink
Upgrade to ESLint 9+
Browse files Browse the repository at this point in the history
  • Loading branch information
ncalteen committed Nov 4, 2024
1 parent 968126b commit 5813fe8
Show file tree
Hide file tree
Showing 10 changed files with 1,230 additions and 773 deletions.
58 changes: 0 additions & 58 deletions .eslintrc.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ DISABLE:
# https://megalinter.io/latest/config-activation/
DISABLE_LINTERS:
- MARKDOWN_MARKDOWN_TABLE_FORMATTER
- REPOSITORY_KICS
- REPOSITORY_TRIVY
- TYPESCRIPT_STANDARD

# List of enabled but not blocking linters keys
Expand Down
3 changes: 2 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

79 changes: 79 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import { fixupPluginRules } from '@eslint/compat'
import { FlatCompat } from '@eslint/eslintrc'
import js from '@eslint/js'
import typescriptEslint from '@typescript-eslint/eslint-plugin'
import tsParser from '@typescript-eslint/parser'
import _import from 'eslint-plugin-import'
import jest from 'eslint-plugin-jest'
import prettier from 'eslint-plugin-prettier'
import globals from 'globals'
import path from 'node:path'
import { fileURLToPath } from 'node:url'

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
})

export default [
{
ignores: ['**/coverage', '**/dist', '**/linter', '**/node_modules']
},
...compat.extends(
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:jest/recommended',
'plugin:prettier/recommended'
),
{
plugins: {
import: fixupPluginRules(_import),
jest,
prettier,
'@typescript-eslint': typescriptEslint
},

languageOptions: {
globals: {
...globals.node,
...globals.jest,
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},

parser: tsParser,
ecmaVersion: 2023,
sourceType: 'module',

parserOptions: {
project: ['tsconfig.eslint.json'],
tsconfigRootDir: '.'
}
},

settings: {
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: 'tsconfig.eslint.json'
}
}
},

rules: {
camelcase: 'off',
'eslint-comments/no-use': 'off',
'eslint-comments/no-unused-disable': 'off',
'i18n-text/no-en': 'off',
'import/no-namespace': 'off',
'no-console': 'off',
'no-shadow': 'off',
'no-unused-vars': 'off',
'prettier/prettier': 'error'
}
}
]
Loading

0 comments on commit 5813fe8

Please sign in to comment.