Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
48 lines (47 loc) · 1.73 KB
/
Copy patheslint.config.js
File metadata and controls
48 lines (47 loc) · 1.73 KB
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
45
46
47
48
const js = require('@eslint/js');
const tsPlugin = require('@typescript-eslint/eslint-plugin');
const tsParser = require('@typescript-eslint/parser');
const prettier = require('eslint-config-prettier');
const importPlugin = require('eslint-plugin-import');
const globals = require('globals');
module.exports = [
{ ignores: ['node_modules/**', 'lib/**', 'examples/**', 'docs/**'] },
{
files: ['**/*.{js,ts}'],
linterOptions: { reportUnusedDisableDirectives: 'off' },
languageOptions: {
parser: tsParser,
ecmaVersion: 2021,
sourceType: 'module',
globals: { ...globals.es2021, ...globals.node, ...globals.jest },
},
plugins: { '@typescript-eslint': tsPlugin, import: importPlugin },
rules: {
...js.configs.recommended.rules,
...tsPlugin.configs['eslint-recommended'].overrides[0].rules,
...tsPlugin.configs.recommended.rules,
...prettier.rules,
'no-console': ['error', { allow: ['warn', 'error', 'time'] }],
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
camelcase: ['error', { properties: 'never', ignoreDestructuring: true }],
// TypeScript handles undefined variable checks; core no-undef flags TS globals.
'no-undef': 'off',
'import/extensions': ['error', 'ignorePackages'],
},
settings: { 'import/extensions': ['.js'] },
},
{
files: ['**/*.spec.ts', '**/*.test.ts', 'tests/**/*.ts'],
rules: { 'import/extensions': 'off' },
},
];