@enormora/eslint-config-typescript 0.0.11 → 0.0.13

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.
Files changed (3) hide show
  1. package/package.json +10 -5
  2. package/readme.md +29 -0
  3. package/typescript.js +10 -7
package/package.json CHANGED
@@ -1,19 +1,24 @@
1
1
  {
2
+ "author": "Mathias Schreck <schreck.mathias@gmail.com>",
3
+ "contributors": [
4
+ "Christian Rackerseder <github@echooff.de>"
5
+ ],
2
6
  "dependencies": {
3
- "@typescript-eslint/eslint-plugin": "6.20.0",
4
- "@typescript-eslint/parser": "6.20.0",
5
- "eslint-plugin-functional": "6.0.0"
7
+ "@typescript-eslint/eslint-plugin": "8.0.0-alpha.18",
8
+ "@typescript-eslint/parser": "8.0.0-alpha.18",
9
+ "eslint-plugin-functional": "6.6.3"
6
10
  },
11
+ "description": "Enormora’s ESLint typescript configuration",
7
12
  "license": "MIT",
8
13
  "main": "typescript.js",
9
14
  "name": "@enormora/eslint-config-typescript",
10
15
  "peerDependencies": {
11
- "@enormora/eslint-config-base": "0.0.11"
16
+ "@enormora/eslint-config-base": "0.0.13"
12
17
  },
13
18
  "repository": {
14
19
  "type": "git",
15
20
  "url": "git://github.com/enormora/eslint-config.git"
16
21
  },
17
22
  "type": "module",
18
- "version": "0.0.11"
23
+ "version": "0.0.13"
19
24
  }
package/readme.md ADDED
@@ -0,0 +1,29 @@
1
+ # `@enormora/eslint-config-typescript`
2
+
3
+ Config preset for typescript, enabling specific rules and compiler settings.
4
+
5
+ ## Install & Setup
6
+
7
+ Install the `@enormora/eslint-config-typescript` and the base preset package via npm:
8
+
9
+ ```bash
10
+ npm install --save-dev @enormora/eslint-config-base @enormora/eslint-config-typescript
11
+ ```
12
+
13
+ Create an ESLint configuration file (e.g., `eslint.config.js`) in your project and add the base and node config to the configuration array:
14
+
15
+ ```javascript
16
+ import { baseConfig } from '@enormora/eslint-config-base';
17
+ import { typescriptConfig } from '@enormora/eslint-config-typescript';
18
+
19
+ export default [
20
+ {
21
+ ignores: ['dist/**/*']
22
+ },
23
+ baseConfig,
24
+ {
25
+ ...typescriptConfig,
26
+ files: ['**/*.ts']
27
+ }
28
+ ];
29
+ ```
package/typescript.js CHANGED
@@ -33,7 +33,7 @@ export const typescriptConfig = {
33
33
  jsx: false,
34
34
  globalReturn: false
35
35
  },
36
- EXPERIMENTAL_useProjectService: true,
36
+ projectService: true,
37
37
  project: 'tsconfig.json'
38
38
  }
39
39
  },
@@ -136,10 +136,11 @@ export const typescriptConfig = {
136
136
  ...configureWrappedCoreRule('no-array-constructor'),
137
137
  ...configureWrappedCoreRule('no-empty-function'),
138
138
  '@typescript-eslint/no-empty-function': 'off',
139
- '@typescript-eslint/no-empty-interface': [
139
+ '@typescript-eslint/no-empty-object-type': [
140
140
  'error',
141
141
  {
142
- allowSingleExtends: true
142
+ allowInterfaces: 'with-single-extends',
143
+ allowObjectTypes: 'never'
143
144
  }
144
145
  ],
145
146
  '@typescript-eslint/no-explicit-any': 'error',
@@ -207,7 +208,7 @@ export const typescriptConfig = {
207
208
  allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false
208
209
  }
209
210
  ],
210
- '@typescript-eslint/no-throw-literal': 'error',
211
+ '@typescript-eslint/only-throw-error': 'error',
211
212
  '@typescript-eslint/prefer-optional-chain': 'error',
212
213
  '@typescript-eslint/prefer-nullish-coalescing': 'error',
213
214
  '@typescript-eslint/ban-ts-comment': 'off',
@@ -218,7 +219,7 @@ export const typescriptConfig = {
218
219
  '@typescript-eslint/explicit-member-accessibility': 'off',
219
220
  '@typescript-eslint/explicit-module-boundary-types': 'off',
220
221
  '@typescript-eslint/init-declarations': 'off',
221
- '@typescript-eslint/method-signature-style': ['error', 'method'],
222
+ '@typescript-eslint/method-signature-style': ['error', 'property'],
222
223
  '@typescript-eslint/no-base-to-string': 'error',
223
224
  ...configureWrappedCoreRule('no-dupe-class-members'),
224
225
  '@typescript-eslint/no-dynamic-delete': ['error'],
@@ -263,7 +264,6 @@ export const typescriptConfig = {
263
264
  '@typescript-eslint/no-confusing-non-null-assertion': ['error'],
264
265
  '@typescript-eslint/prefer-enum-initializers': ['off'],
265
266
  '@typescript-eslint/prefer-literal-enum-member': ['off'],
266
- '@typescript-eslint/no-loss-of-precision': ['off'],
267
267
  ...configureWrappedCoreRule('no-redeclare'),
268
268
  ...configureWrappedCoreRule('no-shadow'),
269
269
  '@typescript-eslint/consistent-type-imports': [
@@ -322,6 +322,7 @@ export const typescriptConfig = {
322
322
  '@typescript-eslint/no-array-delete': 'error',
323
323
  '@typescript-eslint/no-useless-template-literals': 'error',
324
324
  ...configureWrappedCoreRule('prefer-promise-reject-errors'),
325
+ '@typescript-eslint/prefer-find': 'error',
325
326
 
326
327
  'functional/functional-parameters': 'off',
327
328
  'functional/immutable-data': 'off',
@@ -395,6 +396,8 @@ export const typescriptConfig = {
395
396
  ],
396
397
  ignoreInterfaces: false
397
398
  }
398
- ]
399
+ ],
400
+ ...configureWrappedCoreRule('consistent-return'),
401
+ '@typescript-eslint/use-unknown-in-catch-callback-variable': 'error'
399
402
  }
400
403
  };