@@ -5,142 +5,20 @@ module.exports = {
55 tsconfigRootDir : __dirname , // this is the reason this is a .js file
66 project : [ './tsconfig.eslint.json' ] ,
77 } ,
8- plugins : [
9- 'eslint-plugin-tsdoc' ,
10- 'eslint-plugin-import' ,
11- 'eslint-plugin-jest' ,
12- 'eslint-plugin-unused-imports'
13- ] ,
148 extends : [
15- 'es/node' ,
16- 'plugin:import/errors' ,
17- 'plugin:import/warnings' ,
18- 'plugin:import/typescript'
9+ '@rubensworks'
1910 ] ,
20- settings : {
21- 'import/parsers' : {
22- '@typescript-eslint/parser' : [ '.ts' , '.tsx' ]
23- } ,
24- 'import/resolver' : {
25- 'typescript' : {
26- 'alwaysTryTypes' : true // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/rdf-js`
27- } ,
28- }
29- } ,
30- globals : {
31- window : false ,
32- fetch : false ,
33- Headers : false ,
34- Request : false ,
35- XMLHttpRequest : false ,
36- } ,
3711 rules : {
38- // Default
39- 'class-methods-use-this' : 'off' , // Conflicts with functions from interfaces that sometimes don't require `this`
40- 'comma-dangle' : [ 'error' , 'always-multiline' ] ,
41- 'dot-location' : [ 'error' , 'property' ] ,
42- 'lines-between-class-members' : [ 'error' , 'always' , { exceptAfterSingleLine : true } ] ,
43- 'no-underscore-dangle' : 'off' , // Conflicts with external libraries
44- 'padding-line-between-statements' : 'off' ,
45- 'no-param-reassign' : 'off' ,
46- 'func-style' : 'off' ,
47- 'new-cap' : 'off' ,
48- 'lines-around-comment' : [ 'error' , {
49- beforeBlockComment : false ,
50- afterBlockComment : false ,
51- beforeLineComment : false ,
52- afterLineComment : false ,
53- } ] ,
54- 'no-multi-assign' : 'off' ,
55- 'no-plusplus' : 'off' ,
56- 'guard-for-in' : 'off' ,
57- 'sort-imports' : 'off' , // Disabled in favor of eslint-plugin-import
58- 'prefer-named-capture-group' : 'off' ,
59- 'max-len' : [ 'error' , {
60- code : 120 ,
61- ignoreTemplateLiterals : true ,
62- } ] ,
63- 'unicorn/consistent-function-scoping' : 'off' ,
64- 'no-warning-comments' : 'off' ,
65- 'no-mixed-operators' : 'off' ,
66- 'prefer-destructuring' : 'off' ,
67- 'default-case' : 'off' , // TSC already takes care of these checks
68- 'no-loop-func' : 'off' ,
69- 'unicorn/no-fn-reference-in-iterator' : 'off' ,
70- 'extended/consistent-err-names' : 'off' ,
71- 'unicorn/prefer-replace-all' : 'off' ,
72-
73- // TS
74- '@typescript-eslint/array-type' : [ 'error' , { default : 'array' } ] ,
75- '@typescript-eslint/generic-type-naming' : 'off' ,
76- '@typescript-eslint/no-empty-interface' : 'off' ,
77- '@typescript-eslint/no-unnecessary-condition' : 'off' , // Problems with optional parameters
78- '@typescript-eslint/space-before-function-paren' : [ 'error' , 'never' ] ,
79- '@typescript-eslint/promise-function-async' : 'off' ,
80- '@typescript-eslint/consistent-type-assertions' : [ 'error' , { assertionStyle : 'angle-bracket' } ] ,
81- '@typescript-eslint/member-naming' : 'off' ,
82- '@typescript-eslint/naming-convention' : 'error' ,
83- '@typescript-eslint/no-dynamic-delete' : 'off' ,
84- '@typescript-eslint/explicit-function-return-type' : 'off' ,
85- '@typescript-eslint/no-use-before-define' : 'off' ,
86- '@typescript-eslint/prefer-nullish-coalescing' : 'off' ,
87-
88- // Import
89- 'import/order' : [ 'error' , {
90- alphabetize : {
91- order : 'asc' ,
92- caseInsensitive : true
12+ '@typescript-eslint/naming-convention' : [
13+ 'error' ,
14+ {
15+ 'selector' : 'interface' ,
16+ 'format' : [ 'PascalCase' ] ,
17+ 'custom' : {
18+ 'regex' : '^[A-Z]' ,
19+ 'match' : true
20+ }
9321 }
94- } ] ,
95- 'import/no-unused-modules' : 'off' ,
96- 'unused-imports/no-unused-imports-ts' : 'error' ,
97-
98- // TODO: Try to re-enable the following rules in the future
99- 'tsdoc/syntax' : 'off' ,
100- } ,
101- overrides : [
102- {
103- // Specific rules for bin files
104- files : [ '**/bin/*.ts' ] ,
105- rules : {
106- 'no-process-env' : 'off' ,
107- }
108- } ,
109- {
110- // Specific rules for test files
111- files : [ 'test/**/*.ts' ] ,
112- env : {
113- 'jest/globals' : true ,
114- } ,
115- globals : {
116- 'spyOn' : false ,
117- } ,
118- rules : {
119- 'mocha/no-synchronous-tests' : 'off' ,
120- 'mocha/valid-test-description' : 'off' ,
121- 'mocha/no-sibling-hooks' : 'off' ,
122- 'mocha/no-top-level-hooks' : 'off' ,
123-
124- 'max-statements-per-line' : 'off' ,
125- 'id-length' : 'off' ,
126- 'arrow-body-style' : 'off' ,
127- 'line-comment-position' : 'off' ,
128- 'no-inline-comments' : 'off' ,
129- 'unicorn/filename-case' : 'off' ,
130- 'no-new' : 'off' ,
131- 'unicorn/no-nested-ternary' : 'off' ,
132- 'no-return-assign' : 'off' ,
133- 'no-useless-call' : 'off' ,
134- 'no-sync' : 'off' ,
135-
136- '@typescript-eslint/brace-style' : 'off' ,
137- '@typescript-eslint/ban-ts-comment' : 'off' ,
138- '@typescript-eslint/ban-ts-ignore' : 'off' ,
139- '@typescript-eslint/explicit-function-return-type' : 'off' ,
140- '@typescript-eslint/unbound-method' : 'off' ,
141- '@typescript-eslint/no-extra-parens' : 'off' ,
142- '@typescript-eslint/restrict-plus-operands' : 'off'
143- }
144- }
145- ] ,
22+ ] ,
23+ }
14624} ;
0 commit comments