Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
63 lines (57 loc) · 1.69 KB
/
Copy patheslint.config.js
File metadata and controls
63 lines (57 loc) · 1.69 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import js from '@eslint/js';
import {defineConfig, globalIgnores} from 'eslint/config';
import prettierConfig from 'eslint-config-prettier/flat';
import n from 'eslint-plugin-n';
import tseslint from 'typescript-eslint';
export default defineConfig([
globalIgnores([
'build/',
'coverage/',
'test/tscc/',
'deno.ts',
'test/deno/cliui',
]),
js.configs.recommended,
n.configs['flat/recommended'],
// package.json has "type": "module", so treat .cjs files as CommonJS explicitly.
{files: ['**/*.cjs'], ...n.configs['flat/recommended-script']},
// Rules previously supplied by gts (formatting rules dropped: Prettier owns those).
{
rules: {
'block-scoped-var': 'error',
eqeqeq: 'error',
'no-var': 'error',
'prefer-const': 'error',
'prefer-arrow-callback': 'error',
'no-restricted-properties': [
'error',
{object: 'describe', property: 'only'},
{object: 'it', property: 'only'},
],
},
},
{
files: ['**/*.ts'],
extends: [tseslint.configs.recommended],
rules: {
// Carried over from gts.
'@typescript-eslint/ban-ts-comment': 'warn',
'n/no-missing-import': 'off',
'n/no-missing-require': 'off',
'n/no-unsupported-features/es-syntax': 'off',
// Project-specific.
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
},
},
{
files: ['test/**/*.mjs'],
rules: {
'prefer-arrow-callback': 'off',
},
},
// Must be last: turns off rules that conflict with Prettier.
prettierConfig,
]);