@gtvmbh/eslint-config 1.1.8 → 2.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,9 +1,36 @@
1
1
  # Using the GTV ESLint configurations
2
2
 
3
3
  1. Run `npm i @gtvmbh/eslint-config --save-dev` to install the GTV ESLint configuration. Take note of the messages about missing peer dependencies.
4
- 2. Add a file named `.eslintrc.js` in the project root, setting up ESLint the use of the GTV ESLint configurations. See the `examples` folder for templates.
5
- 3. Run ESLint from the project root to see if everything works as intended:
6
- * `./node_modules/.bin/eslint -c .eslintrc.js .` for javascript projects.
7
- * `./node_modules/.bin/eslint -c .eslintrc.js . --ext .ts` for typescript projects.
4
+ 2. Add a file named `eslint.config.js` in the project root. Pick the configuration that fits your project type:
5
+ * JavaScript:
6
+ ```js
7
+ import jsConfig from '@gtvmbh/eslint-config';
8
+
9
+ export default jsConfig;
10
+ ```
11
+ * TypeScript:
12
+ ```js
13
+ import tsConfig from '@gtvmbh/eslint-config/eslint-config-ts';
14
+
15
+ export default tsConfig;
16
+ ```
17
+ * Angular:
18
+ ```js
19
+ import angularConfig from '@gtvmbh/eslint-config/eslint-config-angular';
20
+
21
+ export default angularConfig;
22
+ ```
23
+ * ViDaLa (layer on top of TypeScript):
24
+ ```js
25
+ import tsConfig from '@gtvmbh/eslint-config/eslint-config-ts';
26
+ import vidalaConfig from '@gtvmbh/eslint-config/eslint-config-vidala';
27
+
28
+ export default [
29
+ ...tsConfig,
30
+ ...vidalaConfig
31
+ ];
32
+ ```
33
+ 3. Run ESLint from the project root to see if everything works as intended:
34
+ * `./node_modules/.bin/eslint .`
8
35
  4. Configure your IDE to use ESLint to check automatically. In VS Code it should be enough to install the ESLint extension and everything should be picked up automatically.
9
36
  5. Brew some tea to cope with all your new linter errors.
@@ -1 +1,21 @@
1
- module.exports = require('./src/angular');
1
+ import { defineConfig } from 'eslint/config';
2
+ import typescriptConfig from './eslint-config-ts';
3
+
4
+ export default defineConfig([
5
+ ...typescriptConfig,
6
+ {
7
+ rules: {
8
+ // enforces consistent usage of uppercase functions with new operator
9
+ 'new-cap': [
10
+ 'error',
11
+ {
12
+ capIsNewExceptions: [
13
+ // Exceptions for angular decorators (@Component, @Input etc), array may be extended if needed.
14
+ // List of available decorators from https://angular.dev/api?type=decorator. Last checked 2026-02-25
15
+ 'Attribute', 'Component', 'ContentChild', 'ContentChildren', 'Directive', 'Host', 'HostBinding', 'HostListener', 'Inject', 'Injectable', 'Input', 'NgModule', 'Optional', 'Output', 'Pipe', 'Self', 'SkipSelf', 'ViewChild', 'ViewChildren'
16
+ ]
17
+ }
18
+ ]
19
+ }
20
+ }
21
+ ]);
@@ -1 +1,21 @@
1
- module.exports = require('./src/typescript');
1
+ import { defineConfig } from 'eslint/config';
2
+ import tseslint from 'typescript-eslint';
3
+ import javascriptConfig from './index';
4
+
5
+ export default defineConfig([
6
+ ...javascriptConfig,
7
+ ...tseslint.configs.strictTypeChecked,
8
+ {
9
+ files: ['**/*.ts', '**/*.tsx'],
10
+ rules: {
11
+ '@typescript-eslint/switch-exhaustiveness-check': ['error', {
12
+ allowDefaultCaseForExhaustiveSwitch: false,
13
+ requireDefaultForNonUnion: true,
14
+ considerDefaultExhaustiveForUnions: true
15
+ }],
16
+ '@typescript-eslint/member-ordering': 'off',
17
+ '@typescript-eslint/no-extraneous-class': ['error', { allowWithDecorator: true }],
18
+ 'no-redeclare': 'off' // Typescript doesn't need the linter to check this
19
+ }
20
+ }
21
+ ]);
@@ -1 +1,17 @@
1
- module.exports = require('./src/vidala');
1
+ import { defineConfig } from 'eslint/config';
2
+
3
+ export default defineConfig([
4
+ {
5
+ rules: {
6
+ 'no-restricted-imports': ['error', {
7
+ patterns: [{
8
+ group: ['ViDaLa/*'],
9
+ caseSensitive: true
10
+ }]
11
+ }],
12
+ '@typescript-eslint/unbound-method': 'off',
13
+ 'prefer-named-capture-group': 'off',
14
+ '@typescript-eslint/default-param-last': 'warn'
15
+ }
16
+ }
17
+ ]);
package/index.js CHANGED
@@ -1 +1,43 @@
1
- module.exports = require('./src/default');
1
+ import { defineConfig } from 'eslint/config';
2
+ import stylistic from '@stylistic/eslint-plugin';
3
+ import js from '@eslint/js';
4
+
5
+ export default defineConfig([
6
+ {
7
+ plugins: {
8
+ '@stylistic': stylistic,
9
+ js
10
+ },
11
+ extends: [
12
+ 'js/recommended',
13
+ 'plugin:@stylistic/recommended-extends'
14
+ ],
15
+ files: ['**/*.js', '**/*.jsx'],
16
+ rules: {
17
+ // Stylistic rules
18
+ '@stylistic/brace-style': '1tbs', // one true brace style
19
+ '@stylistic/no-extra-semi': 'error',
20
+ '@stylistic/no-multiple-empty-lines': ['error', {
21
+ max: 1,
22
+ maxBOF: 0,
23
+ maxEOF: 1
24
+ }],
25
+ '@stylistic/padding-line-between-statements': ['error', [
26
+ {
27
+ blankLine: 'always',
28
+ prev: '*',
29
+ next: 'return'
30
+ }
31
+ ]],
32
+
33
+ // ESLint rules
34
+ 'function-paren-newline': 'error',
35
+ 'max-lines': 'off',
36
+ 'max-lines-per-function': 'off',
37
+ 'max-nested-callbacks': ['warn', { max: 3 }],
38
+ 'max-params': ['warn', { max: 7 }],
39
+ 'no-console': ['warn', { allow: ['info', 'warn', 'error'] }],
40
+ 'prefer-destructuring': 'off'
41
+ }
42
+ }
43
+ ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gtvmbh/eslint-config",
3
- "version": "1.1.8",
3
+ "version": "2.0.0-rc.2",
4
4
  "description": "ESLint configurations for various project types developed by Gesellschaft für Technische Visualistik",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -10,9 +10,7 @@
10
10
  "type": "git",
11
11
  "url": "https://github.com/GesellschaftFuerTechnischeVisualistik/gtv-linter-config.git"
12
12
  },
13
- "engines": {
14
- "node": ">=16.0.0 <=18.x.x"
15
- },
13
+ "type": "module",
16
14
  "keywords": [
17
15
  "eslint",
18
16
  "eslintconfig"
@@ -20,8 +18,9 @@
20
18
  "author": "Gesellschaft für Technische Visualistik mbH",
21
19
  "license": "MIT",
22
20
  "dependencies": {
23
- "eslint": "^8.47.0",
24
- "@typescript-eslint/eslint-plugin": "^6.4.1",
25
- "@typescript-eslint/parser": "^6.4.1"
21
+ "@eslint/js": "^10.0.0",
22
+ "@stylistic/eslint-plugin": "^5.8.0",
23
+ "eslint": "^10.0.0",
24
+ "typescript-eslint": "^8.56.0"
26
25
  }
27
26
  }
package/src/angular.js DELETED
@@ -1,18 +0,0 @@
1
- module.exports = {
2
- extends: [
3
- '@gtvmbh/eslint-config/eslint-config-ts'
4
- ],
5
- rules: {
6
-
7
- // enforces consistent usage of uppercase functions with new operator
8
- 'new-cap': [
9
- 'error',
10
- {
11
- 'capIsNewExceptions': [
12
- // exceptions for angular decorators (@Component, @Input etc), array may be extended if needed.
13
- 'Component', 'NgModule', 'ViewChild', 'Injectable', 'Input', 'Output', 'HostListener', 'Pipe', 'Inject', 'Directive', 'HostBinding'
14
- ]
15
- }
16
- ]
17
- }
18
- };
package/src/default.js DELETED
@@ -1,238 +0,0 @@
1
- module.exports = {
2
- extends: [
3
- 'eslint:recommended',
4
- ],
5
- rules: {
6
- 'no-extra-parens': ['warn', 'all', { 'nestedBinaryExpressions': false }],
7
- 'no-setter-return': 'warn',
8
- 'no-template-curly-in-string': 'warn',
9
- 'accessor-pairs': 'error',
10
- 'array-callback-return': 'warn',
11
- 'block-scoped-var': 'warn',
12
- 'class-methods-use-this': 'off',
13
- 'complexity': 'off',
14
- 'consistent-return': 'off',
15
- 'curly': 'error',
16
- 'default-case': 'warn',
17
- 'default-case-last': 'off',
18
- 'default-param-last': 'error',
19
- 'dot-location': ['error', 'property'],
20
- 'dot-notation': 'off',
21
- 'eqeqeq': ['error', 'always', {'null': 'ignore'}],
22
- 'grouped-accessor-pairs': 'warn',
23
- 'guard-for-in': 'off',
24
- 'max-classes-per-file': 'off',
25
- 'no-alert': 'warn',
26
- 'no-caller': 'error',
27
- 'no-constructor-return': 'error',
28
- 'no-div-regex': 'off',
29
- 'no-else-return': 'off',
30
- 'no-empty-function': 'off',
31
- 'no-eq-null': 'off',
32
- 'no-eval': 'error',
33
- 'no-extend-native': 'off',
34
- 'no-extra-bind': 'warn',
35
- 'no-extra-label': 'error',
36
- 'no-floating-decimal': 'off',
37
- 'no-implicit-coercion': [2, {
38
- 'allow': ['!!']
39
- }],
40
- 'no-implicit-globals': 'warn',
41
- 'no-implied-eval': 'error',
42
- 'no-invalid-this': 'error',
43
- 'no-iterator': 'error',
44
- 'no-labels': 'error',
45
- 'no-lone-blocks': 'error',
46
- 'no-loop-func': 'warn',
47
- 'no-magic-numbers': 'off',
48
- 'no-multi-spaces': 'error',
49
- 'no-multi-str': 'error',
50
- 'no-new': 'warn',
51
- 'no-new-func': 'error',
52
- 'no-new-wrappers': 'error',
53
- 'no-octal-escape': 'error',
54
- 'no-param-reassign': 'error',
55
- 'no-proto': 'error',
56
- 'no-restricted-properties': 'off',
57
- 'no-return-assign': ['error', 'except-parens'],
58
- 'no-return-await': 'warn',
59
- 'no-script-url': 'error',
60
- 'no-self-compare': 'error',
61
- 'no-sequences': 'error',
62
- 'no-throw-literal': 'error',
63
- 'no-unmodified-loop-condition': 'warn',
64
- 'no-unused-expressions': 'warn',
65
- 'no-unused-vars': 'warn',
66
- 'no-useless-call': 'warn',
67
- 'no-useless-concat': 'error',
68
- 'no-useless-return': 'error',
69
- 'no-void': 'error',
70
- 'no-warning-comments': 'off',
71
- 'prefer-named-capture-group': 'warn',
72
- 'prefer-promise-reject-errors': 'warn',
73
- 'prefer-regex-literals': 'off',
74
- 'radix': 'off',
75
- 'require-await': 'error',
76
- 'require-unicode-regexp': 'off',
77
- 'vars-on-top': 'off',
78
- 'wrap-iife': 'off',
79
- 'yoda': ['error', 'never', {
80
- 'exceptRange': true
81
- }],
82
- 'init-declarations': 'off',
83
- 'no-label-var': 'error',
84
- 'no-restricted-globals': 'off',
85
- 'no-shadow': 'error',
86
- 'no-undef-init': 'error',
87
- 'no-undefined': 'off',
88
- 'no-use-before-define': 'warn',
89
- 'array-bracket-newline': ['error', {
90
- 'multiline': true
91
- }],
92
- 'array-bracket-spacing': ['error', 'never'],
93
- 'array-element-newline': ['error', 'consistent'],
94
- 'block-spacing': 'error',
95
- 'brace-style': 'error',
96
- 'camelcase': 'error',
97
- 'capitalized-comments': 'off',
98
- 'comma-dangle': 'error',
99
- 'comma-spacing': ['error', {
100
- 'before': false,
101
- 'after': true
102
- }],
103
- 'comma-style': ['error', 'last'],
104
- 'computed-property-spacing': ['error', 'never'],
105
- 'consistent-this': ['error', 'that'],
106
- 'eol-last': ['error', 'always'],
107
- 'func-call-spacing': 'error',
108
- 'func-name-matching': 'off',
109
- 'func-names': 'off',
110
- 'func-style': 'off',
111
- 'function-call-argument-newline': 'off',
112
- 'function-paren-newline': ['error', 'multiline-arguments'],
113
- 'id-blacklist': 'off',
114
- 'id-length': 'off',
115
- 'id-match': 'off',
116
- 'implicit-arrow-linebreak': "off",
117
- 'indent': ["error", 2, { "SwitchCase": 1 }],
118
- 'jsx-quotes': ['error', 'prefer-double'],
119
- 'key-spacing': ['error', {
120
- 'beforeColon': false,
121
- 'afterColon': true
122
- }],
123
- 'keyword-spacing': 'error',
124
- 'line-comment-position': 'off',
125
- 'linebreak-style': 'off',
126
- 'lines-around-comment': 'off',
127
- 'lines-between-class-members': ['error', 'always', { 'exceptAfterSingleLine': true }],
128
- 'max-depth': 'off',
129
- 'max-len': 'off',
130
- 'max-lines': ['warn', {
131
- 'max': 400, 'skipComments': true
132
- }],
133
- 'max-lines-per-function': ['warn', {
134
- 'max': 100
135
- }],
136
- 'max-nested-callbacks': ['warn', 3],
137
- 'max-params': ['warn', 5],
138
- 'max-statements': 'off',
139
- 'max-statements-per-line': ['error', {
140
- 'max': 1
141
- }],
142
- 'multiline-comment-style': 'off',
143
- 'multiline-ternary': ['error', 'always-multiline'],
144
- 'new-cap': 'error',
145
- 'new-parens': 'error',
146
- 'newline-per-chained-call': ['error', {
147
- 'ignoreChainWithDepth': 3
148
- }],
149
- 'no-array-constructor': 'error',
150
- 'no-bitwise': 'off',
151
- 'no-continue': 'off',
152
- 'no-inline-comments': 'off',
153
- 'no-lonely-if': 'off',
154
- 'no-mixed-operators': 'error',
155
- 'no-multi-assign': 'error',
156
- 'no-multiple-empty-lines': 'error',
157
- 'no-negated-condition': 'off',
158
- 'no-nested-ternary': 'off',
159
- 'no-new-object': 'error',
160
- 'no-plusplus': 'off',
161
- 'no-restricted-syntax': 'off',
162
- 'no-tabs': 'error',
163
- 'no-ternary': 'off',
164
- 'no-trailing-spaces': 'error',
165
- 'no-underscore-dangle': 'off',
166
- 'no-unneeded-ternary': 'error',
167
- 'no-whitespace-before-property': 'error',
168
- 'nonblock-statement-body-position': 'off',
169
- 'object-curly-newline': ['error', {
170
- 'consistent': true
171
- }],
172
- 'object-curly-spacing': ['error', 'always'],
173
- 'object-property-newline': ['error', {
174
- 'allowAllPropertiesOnSameLine': true
175
- }],
176
- 'one-var': ['error', 'never'],
177
- 'one-var-declaration-per-line': 'off',
178
- 'operator-assignment': 'off',
179
- 'operator-linebreak': ['error', 'before'],
180
- 'padded-blocks': 'off',
181
- 'padding-line-between-statements': ['error', {
182
- 'blankLine': 'always',
183
- 'prev': '*',
184
- 'next': 'return'
185
- }],
186
- 'prefer-exponentiation-operator': 'off',
187
- 'prefer-object-spread': 'off',
188
- 'quote-props': ['warn', 'consistent-as-needed'],
189
- 'quotes': ['error', 'single', {
190
- 'allowTemplateLiterals': true
191
- }],
192
- 'semi': ['error', 'always'],
193
- 'semi-spacing': 'error',
194
- 'semi-style': 'error',
195
- 'sort-keys': 'off',
196
- 'sort-vars': 'off',
197
- 'space-before-blocks': 'error',
198
- 'space-before-function-paren': ['error', {
199
- 'anonymous': 'always',
200
- 'named': 'never',
201
- 'asyncArrow': 'always'
202
- }],
203
- 'space-in-parens': ['error', 'never'],
204
- 'space-infix-ops': 'error',
205
- 'space-unary-ops': 'error',
206
- 'spaced-comment': 'error',
207
- 'switch-colon-spacing': 'error',
208
- 'template-tag-spacing': 'error',
209
- 'unicode-bom': 'error',
210
- 'wrap-regex': 'off',
211
- 'arrow-body-style': ['error', 'as-needed', {
212
- 'requireReturnForObjectLiteral': false
213
- }],
214
- 'arrow-parens': 'error',
215
- 'arrow-spacing': 'error',
216
- 'generator-star-spacing': 'error',
217
- 'no-confusing-arrow': 'off',
218
- 'no-duplicate-imports': 'error',
219
- 'no-restricted-exports': 'off',
220
- 'no-restricted-imports': 'off',
221
- 'no-useless-computed-key': 'error',
222
- 'no-useless-constructor': 'warn',
223
- 'no-useless-rename': 'error',
224
- 'no-var': 'error',
225
- 'prefer-arrow-callback': 'warn',
226
- 'prefer-const': 'error',
227
- 'prefer-destructuring': 'warn',
228
- 'prefer-numeric-literals': 'warn',
229
- 'prefer-rest-params': 'error',
230
- 'prefer-spread': 'error',
231
- 'prefer-template': 'warn',
232
- 'rest-spread-spacing': 'error',
233
- 'sort-imports': 'off',
234
- 'symbol-description': 'off',
235
- 'template-curly-spacing': ['error', 'never'],
236
- 'yield-star-spacing': 'error'
237
- }
238
- }
package/src/typescript.js DELETED
@@ -1,378 +0,0 @@
1
- module.exports = {
2
- plugins: [
3
- '@typescript-eslint'
4
- ],
5
- extends: [
6
- 'plugin:@typescript-eslint/eslint-recommended',
7
- 'plugin:@typescript-eslint/recommended',
8
- 'plugin:@typescript-eslint/recommended-requiring-type-checking',
9
- '@gtvmbh/eslint-config'
10
- ],
11
- rules: {
12
-
13
- "no-shadow": "off",
14
- "@typescript-eslint/no-shadow": "error",
15
-
16
- // Require that member overloads be consecutive
17
- '@typescript-eslint/adjacent-overload-signatures': 'error',
18
-
19
- // Requires using either T[] or Array<T> for arrays
20
- '@typescript-eslint/array-type': ['error', { default: 'generic' }],
21
-
22
- // Disallows awaiting a value that is not a Thenable
23
- '@typescript-eslint/await-thenable': 'error',
24
-
25
- // Bans // @ts-<directive> comments from being used
26
- '@typescript-eslint/ban-ts-comment': 'off',
27
-
28
- // Bans specific types from being used
29
- '@typescript-eslint/ban-types': 'off',
30
-
31
- // Ensures that literals on classes are exposed in a consistent style
32
- '@typescript-eslint/class-literal-property-style': ['error', 'fields'],
33
-
34
- // Enforces consistent usage of type assertions
35
- '@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }],
36
-
37
- // Consistent with type definition either interface or type
38
- '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
39
-
40
- // Require explicit return types on functions and class methods
41
- '@typescript-eslint/explicit-function-return-type': 'error',
42
-
43
- // Require explicit accessibility modifiers on class properties and methods
44
- // is defined in overrides to allow mixed code base
45
- '@typescript-eslint/explicit-member-accessibility': 'off',
46
-
47
- // Require explicit return and argument types on exported functions' and classes' public class methods
48
- '@typescript-eslint/explicit-module-boundary-types': 'error',
49
-
50
- // Require a specific member delimiter style for interfaces and type literals
51
- '@typescript-eslint/member-delimiter-style': 'error',
52
-
53
- // Require a consistent member declaration order
54
- '@typescript-eslint/member-ordering': 'warn',
55
-
56
- // Enforces using a particular method signature syntax.
57
- '@typescript-eslint/method-signature-style': 'warn', //anscheinend ist 'property' besser, weesschne,
58
-
59
- // Enforces naming conventions for everything across a codebase
60
-
61
- '@typescript-eslint/naming-convention': ['error', {
62
- selector: 'default',
63
- format: ['camelCase', 'UPPER_CASE'],
64
- leadingUnderscore: 'forbid',
65
- },
66
-
67
- {
68
- selector: 'variable',
69
- format: ['camelCase', 'UPPER_CASE'],
70
- leadingUnderscore: 'forbid',
71
- },
72
-
73
- {
74
- selector: 'typeLike',
75
- format: ['PascalCase'],
76
- }],
77
-
78
- // Requires that .toString() is only called on objects which provide useful information when stringified
79
- '@typescript-eslint/no-base-to-string': 'warn',
80
-
81
- // Disallow the delete operator with computed key expressions
82
- '@typescript-eslint/no-dynamic-delete': 'error',
83
-
84
- // Disallow the declaration of empty interfaces
85
- '@typescript-eslint/no-empty-interface': 'warn',
86
-
87
- // Disallow usage of the any type
88
- '@typescript-eslint/no-explicit-any': ['error', { fixToUnknown: true, ignoreRestArgs: false }],
89
-
90
- // Disallow extra non-null assertion
91
- '@typescript-eslint/no-extra-non-null-assertion': 'error',
92
-
93
- // Forbids the use of classes as namespaces
94
- '@typescript-eslint/no-extraneous-class': 'error',
95
-
96
- // Requires Promise-like values to be handled appropriately
97
- '@typescript-eslint/no-floating-promises': 'warn',
98
-
99
- // Disallow iterating over an array with a for-in loop
100
- '@typescript-eslint/no-for-in-array': 'warn',
101
-
102
- // Disallow the use of eval()-like methods
103
- '@typescript-eslint/no-implied-eval': 'error',
104
-
105
- // Disallows explicit type declarations for variables or parameters initialized to a number, string, or boolean
106
- '@typescript-eslint/no-inferrable-types': 'error',
107
-
108
- // Disallows usage of void type outside of generic or return types
109
- '@typescript-eslint/no-invalid-void-type': 'error',
110
-
111
- // Enforce valid definition of new and constructor
112
- '@typescript-eslint/no-misused-new': 'error',
113
-
114
- // Avoid using promises in places not designed to handle them
115
- '@typescript-eslint/no-misused-promises': 'error',
116
-
117
- // Disallow the use of custom TypeScript modules and namespaces
118
- '@typescript-eslint/no-namespace': 'error',
119
-
120
- // Disallows using a non-null assertion after an optional chain expression
121
- '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
122
-
123
- // Disallows non-null assertions using the ! postfix operator
124
- '@typescript-eslint/no-non-null-assertion': 'error',
125
-
126
- // Disallow the use of parameter properties in class constructors
127
- '@typescript-eslint/no-parameter-properties': 'off',
128
-
129
- // Disallows invocation of require()
130
- '@typescript-eslint/no-require-imports': 'error',
131
-
132
- // Disallow aliasing this
133
- '@typescript-eslint/no-this-alias': 'warn',// wie beißt sich das mit that = this in eslint?,
134
-
135
- // Disallow throwing literals as exceptions
136
- '@typescript-eslint/no-throw-literal': 'error',
137
-
138
- // Disallow the use of type aliases
139
- // NOTE (astahl): only prevent simple use of literal objects instead of interfaces, e.g type MyType = { a: string }.
140
- '@typescript-eslint/no-type-alias': 'off',
141
- '@typescript-eslint/consistent-type-definitions': ["error", "interface"],
142
-
143
-
144
- // Flags unnecessary equality comparisons against boolean literals
145
- '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
146
-
147
- // Prevents conditionals where the type is always truthy or always falsy
148
- '@typescript-eslint/no-unnecessary-condition': 'off',
149
-
150
- // Warns when a namespace qualifier is unnecessary
151
- '@typescript-eslint/no-unnecessary-qualifier': 'warn',
152
-
153
- // Enforces that type arguments will not be used if not required
154
- '@typescript-eslint/no-unnecessary-type-arguments': 'warn',
155
-
156
- // Warns if a type assertion does not change the type of an expression
157
- '@typescript-eslint/no-unnecessary-type-assertion': 'warn',
158
-
159
- // Disallows assigning any to variables and properties
160
- '@typescript-eslint/no-unsafe-assignment': 'warn',
161
-
162
- // Disallows calling an any type value
163
- '@typescript-eslint/no-unsafe-call': 'warn',
164
-
165
- // Disallows member access on any typed variables
166
- '@typescript-eslint/no-unsafe-member-access': 'warn',
167
-
168
- // Disallows returning any from a function
169
- '@typescript-eslint/no-unsafe-return': 'warn',
170
-
171
- // Disallows the use of require statements except in import statements
172
- '@typescript-eslint/no-var-requires': 'error',
173
-
174
- // Prefer usage of as const over literal type
175
- '@typescript-eslint/prefer-as-const': 'warn',
176
-
177
- // Prefer a ‘for-of’ loop over a standard ‘for’ loop if the index is only used to access the array being iterated
178
- '@typescript-eslint/prefer-for-of': 'warn',
179
-
180
- // Use function types instead of interfaces with call signatures
181
- '@typescript-eslint/prefer-function-type': 'warn',
182
-
183
- // Enforce includes method over indexOf method
184
- '@typescript-eslint/prefer-includes': 'warn',
185
-
186
- // Require the use of the namespace keyword instead of the module keyword to declare custom TypeScript modules
187
- '@typescript-eslint/prefer-namespace-keyword': 'error',
188
-
189
- // Enforce the usage of the nullish coalescing operator instead of logical chaining
190
- '@typescript-eslint/prefer-nullish-coalescing': 'warn',
191
-
192
- // Prefer using concise optional chain expressions instead of chained logical ands
193
- '@typescript-eslint/prefer-optional-chain': 'warn',
194
-
195
- // Requires that private members are marked as readonly if they're never modified outside of the constructor
196
- '@typescript-eslint/prefer-readonly': 'warn',
197
-
198
- // Requires that function parameters are typed as readonly to prevent accidental mutation of inputs
199
- '@typescript-eslint/prefer-readonly-parameter-types': 'off',
200
-
201
- // Prefer using type parameter when calling Array#reduce instead of casting
202
- '@typescript-eslint/prefer-reduce-type-parameter': 'error',
203
-
204
- // Enforce that RegExp#exec is used instead of String#match if no global flag is provided
205
- '@typescript-eslint/prefer-regexp-exec': 'warn',
206
-
207
- // Enforce the use of String#startsWith and String#endsWith instead of other equivalent methods of checking substrings
208
- '@typescript-eslint/prefer-string-starts-ends-with': 'warn',
209
-
210
- // Recommends using // @ts-expect-error over // @ts-ignore
211
- '@typescript-eslint/prefer-ts-expect-error': 'off', // cool aber TS >= 3.9,
212
-
213
- // Requires any function or method that returns a Promise to be marked async
214
- '@typescript-eslint/promise-function-async': ['error', { checkArrowFunctions: false, checkFunctionExpressions: false }],
215
-
216
- // Requires Array#sort calls to always provide a compareFunction
217
- '@typescript-eslint/require-array-sort-compare': ['warn', { 'ignoreStringArrays': true }],
218
-
219
- // When adding two variables, operands must both be of type number or of type string
220
- '@typescript-eslint/restrict-plus-operands': 'error',
221
-
222
- // Enforce template literal expressions to be of string type
223
- '@typescript-eslint/restrict-template-expressions': 'off', // (oder warn mit allen options an),
224
-
225
- // Restricts the types allowed in boolean expressions
226
- '@typescript-eslint/strict-boolean-expressions': ['warn', {
227
- allowString: true,
228
- allowNumber: true,
229
- allowNullableObject: true,
230
- allowNullableBoolean: false,
231
- allowNullableString: false,
232
- allowNullableNumber: false,
233
- allowNullableEnum: false,
234
- allowAny: false,
235
- allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
236
- }],
237
-
238
- // Exhaustiveness checking in switch with union type
239
- '@typescript-eslint/switch-exhaustiveness-check': 'error',
240
-
241
- // Sets preference level for triple slash directives versus ES6-style import declarations
242
- '@typescript-eslint/triple-slash-reference': ['error', { 'path': 'never', 'types': 'never', 'lib': 'never' }],
243
-
244
- // Require consistent spacing around type annotations
245
- '@typescript-eslint/type-annotation-spacing': 'error',
246
-
247
- // Requires type annotations to exist
248
- '@typescript-eslint/typedef': 'off', // compiler noImplicitAny
249
-
250
- // Enforces unbound methods are called with their expected scope
251
- '@typescript-eslint/unbound-method': ['warn', { 'ignoreStatic': true }],
252
-
253
- // Warns for any two overloads that could be unified into one by using a union or an optional/rest parameter
254
- '@typescript-eslint/unified-signatures': 'warn',
255
-
256
-
257
- /************************************************
258
- * EXTENSION RULES
259
- *
260
- * https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#extension-rules
261
- * In some cases, ESLint provides a rule itself, but it doesn't support TypeScript syntax;
262
- * either it crashes, or it ignores the syntax, or it falsely reports against it. In these
263
- * cases, we create what we call an extension rule; a rule within our plugin that has the
264
- * same functionality, but also supports TypeScript.
265
- */
266
-
267
- // Enforce consistent brace style for blocks
268
- 'brace-style': 'off',
269
- '@typescript-eslint/brace-style': 'error',
270
-
271
- // Enforces consistent spacing before and after commas
272
- 'comma-spacing': 'off',
273
- '@typescript-eslint/comma-spacing': ['error', { 'before': false, 'after': true }],
274
-
275
- // Enforce default parameters to be last
276
- 'default-param-last': 'off',
277
- '@typescript-eslint/default-param-last': 'error',
278
-
279
- // enforce dot notation whenever possible
280
- 'dot-notation': 'off',
281
- '@typescript-eslint/dot-notation': 'off',
282
-
283
- // Require or disallow spacing between function identifiers and their invocations
284
- 'func-call-spacing': 'off',
285
- '@typescript-eslint/func-call-spacing': 'error',
286
-
287
- // Enforce consistent indentation
288
- 'indent': 'off',
289
- '@typescript-eslint/indent': ["error", 2, { "SwitchCase": 1 }],
290
-
291
- // require or disallow initialization in variable declarations
292
- 'init-declarations': 'off',
293
- '@typescript-eslint/init-declarations': 'off',
294
-
295
- // Enforce consistent spacing before and after keywords
296
- 'keyword-spacing': 'off',
297
- '@typescript-eslint/keyword-spacing': 'error',
298
-
299
- // Require or disallow an empty line between class members
300
- 'lines-between-class-members': 'off',
301
- '@typescript-eslint/lines-between-class-members': ['error', 'always', { 'exceptAfterSingleLine': true }],
302
-
303
- // Disallow generic Array constructors
304
- 'no-array-constructor': 'off',
305
- '@typescript-eslint/no-array-constructor': 'error',
306
-
307
- // Disallow duplicate class members
308
- 'no-dupe-class-members': 'off',
309
- '@typescript-eslint/no-dupe-class-members': 'error',
310
-
311
- // Disallow empty functions
312
- 'no-empty-function': 'off',
313
- '@typescript-eslint/no-empty-function': 'off',
314
-
315
- // Disallow unnecessary parentheses
316
- "no-extra-parens": "off",
317
- "@typescript-eslint/no-extra-parens": ["warn", "all", { "conditionalAssign": false, "returnAssign": false, "nestedBinaryExpressions": false }],
318
-
319
- // Disallow unnecessary semicolons
320
- 'no-extra-semi': 'off',
321
- '@typescript-eslint/no-extra-semi': 'warn',
322
-
323
- // disallow this keywords outside of classes or class-like objects
324
- 'no-invalid-this': 'off',
325
- '@typescript-eslint/no-invalid-this': 'error',
326
-
327
- // Disallow magic numbers
328
- 'no-magic-numbers': 'off',
329
- '@typescript-eslint/no-magic-numbers': 'off',
330
-
331
- // Disallow unused expressions
332
- 'no-unused-expressions': 'off',
333
- '@typescript-eslint/no-unused-expressions': ['error', { allowShortCircuit: true, allowTernary: true }],
334
-
335
- // Disallow unused variables
336
- 'no-unused-vars': 'off',
337
- '@typescript-eslint/no-unused-vars': 'error',
338
-
339
- // Disallow the use of variables before they are defined
340
- 'no-use-before-define': 'off',
341
- '@typescript-eslint/no-use-before-define': 'warn',
342
-
343
- // Disallow unnecessary constructors
344
- 'no-useless-constructor': 'off',
345
- '@typescript-eslint/no-useless-constructor': 'warn',
346
-
347
- // Enforce the consistent use of either backticks, double, or single quotes
348
- 'quotes': 'off',
349
- '@typescript-eslint/quotes': ['error', 'single', { 'allowTemplateLiterals': true }],
350
-
351
- // Disallow async functions which have no await expression
352
- 'require-await': 'off',
353
- '@typescript-eslint/require-await': 'error',
354
-
355
- // Enforces consistent returning of awaited values
356
- 'no-return-await': 'off',
357
- '@typescript-eslint/return-await': 'warn',
358
-
359
- // Require or disallow semicolons instead of ASI
360
- 'semi': 'off',
361
- '@typescript-eslint/semi': ['error', 'always'],
362
-
363
- // Enforces consistent spacing before function parenthesis
364
- 'space-before-function-paren': 'off',
365
- '@typescript-eslint/space-before-function-paren': ['error', { 'anonymous': 'always', 'named': 'never', 'asyncArrow': 'always' }],
366
-
367
- },
368
- overrides: [
369
- {
370
- // enable the rule specifically for TypeScript files
371
- files: ['*.ts', '*.tsx'],
372
- rules: {
373
- // Require explicit accessibility modifiers on class properties and methods
374
- '@typescript-eslint/explicit-member-accessibility': 'error'
375
- }
376
- }
377
- ]
378
- };
package/src/vidala.js DELETED
@@ -1,13 +0,0 @@
1
- module.exports = {
2
- rules: {
3
- 'no-restricted-imports': ['error', {
4
- 'patterns': [{
5
- "group": ['ViDaLa/*'],
6
- "caseSensitive": true
7
- }]
8
- }],
9
- '@typescript-eslint/unbound-method': 'off',
10
- 'prefer-named-capture-group': 'off',
11
- '@typescript-eslint/default-param-last': 'warn'
12
- }
13
- };