forked from macropygia/static-site-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
60 lines (58 loc) · 1.69 KB
/
.eslintrc.cjs
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
// @ts-check
const { defineConfig } = require('eslint-define-config') // eslint-disable-line
module.exports = defineConfig({
root: true,
env: {
es2021: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:n/recommended',
'prettier',
],
plugins: ['eslint-plugin-tsdoc'],
parserOptions: {
ecmaVersion: 'latest',
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: 'packages/*/tsconfig.json',
},
},
},
rules: {
// Required settings
'n/no-unsupported-features/es-syntax': 'off', // Required to use import
// eslint-plugin-import
'import/order': ['error', { 'newlines-between': 'always' }], // Required to use autofix
'import/no-named-as-default-member': 'off', // When building a subproject with dual packages, some packages will not load if this option is satisfied.
// eslint-import-resolver-typescript
'import/no-unresolved': 'error', // Enable main feature
// eslint-plugin-tsdoc
'tsdoc/syntax': 'warn', // Required to use autofix
// Optional settings
// for Map
'@typescript-eslint/no-non-null-assertion': 'off',
// loosen
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-interface': 'off',
},
overrides: [
{
files: ['packages/*/__tests__/**/*.{js,cjs,mjs,ts}', 'vitest.config.ts'],
env: { node: true },
rules: {
'import/no-extraneous-dependencies': 'off',
'n/no-extraneous-import': 'off',
'no-console': 'off',
},
},
],
})