This repository was archived by the owner on May 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathimport.ts
76 lines (73 loc) · 2.49 KB
/
import.ts
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
64
65
66
67
68
69
70
71
72
73
74
75
76
import { extensions } from './constants'
export const importSettings = {
'import/extensions': extensions.js,
'import/resolver': {
node: {
extensions: extensions.js,
},
},
'import/core-modules': [],
'import/ignore': ['\\.(coffee|scss|css|less|hbs|svg|json)$'],
'import/internal-regex': '^@types/',
}
interface ImportRules {
[rule: string]: unknown
'import/extensions': [string, string, Record<string, 'never'>]
}
export const importRules: ImportRules = {
'import/no-unresolved': ['error', { commonjs: true, caseSensitive: true }],
'import/no-anonymous-default-export': [
'error',
{
allowCallExpression: false,
},
],
'import/export': 'error',
// 'import/no-extraneous-dependencies': [
// 'error',
// {
// devDependencies: [
// 'test/**', // tape, common npm pattern
// 'tests/**', // also common npm pattern
// 'spec/**', // mocha, rspec-like pattern
// '**/__tests__/**', // jest pattern
// '**/__mocks__/**', // jest pattern
// 'test.{js,jsx}', // repos with a single test file
// 'test-*.{js,jsx}', // repos with multiple top-level test files
// '**/*{.,_}{test,spec}.{js,jsx}', // tests where the extension or filename suffix denotes that it is a test
// '**/jest.config.js', // jest config
// '**/jest.setup.js', // jest setup
// '**/vue.config.js', // vue-cli config
// '**/webpack.config.js', // webpack config
// '**/webpack.config.*.js', // webpack config
// '**/rollup.config.js', // rollup config
// '**/rollup.config.*.js', // rollup config
// '**/gulpfile.js', // gulp config
// '**/gulpfile.*.js', // gulp config
// '**/Gruntfile{,.js}', // grunt config
// '**/protractor.conf.js', // protractor config
// '**/protractor.conf.*.js', // protractor config
// '**/karma.conf.js', // karma config
// ],
// optionalDependencies: false,
// },
// ],
'import/no-mutable-exports': 'error',
'import/no-amd': 'error',
'import/first': 'error',
'import/no-duplicates': 'error',
'import/extensions': [
'warn',
'ignorePackages',
{
js: 'never',
mjs: 'never',
jsx: 'never',
},
],
'import/newline-after-import': 'warn',
'import/no-webpack-loader-syntax': 'error',
'import/no-self-import': 'error',
'import/no-cycle': ['error', { maxDepth: Number.POSITIVE_INFINITY }],
'import/no-useless-path-segments': ['warn', { commonjs: true }],
}