-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
eslint.config.mjs
44 lines (40 loc) · 1.48 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import globals from 'globals'
import path from 'path'
import {fileURLToPath} from 'url'
import {FlatCompat} from '@eslint/eslintrc'
import pluginJs from '@eslint/js'
import prettierConfig from 'eslint-config-prettier'
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
// mimic CommonJS variables -- not needed if using CommonJS
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const compat = new FlatCompat({ baseDirectory: __dirname, recommendedConfig: pluginJs.configs.recommended })
export default [
{ languageOptions: { globals: globals.browser }},
{
ignores: [
'dist/**',
'lib/**',
'node_modules/**',
'jest.config.js',
'coverage/**'
]
},
...compat.extends("standard-with-typescript").map((config) => ({
...config,
files: ["**/*.tsx", "**/*.ts"],
rules: {
...config.rules,
"@typescript-eslint/semi": ["error", "always"],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/prefer-ts-expect-error": "off",
"no-import-assign": "off",
},
})),
prettierConfig, // Turns off all ESLint rules that have the potential to interfere with Prettier rules.
eslintPluginPrettierRecommended,
]