Skip to content

Commit 0fb9a47

Browse files
authored
Merge pull request #8 from dotmh/feature/update-to-eslint9
feat(eslint-config-ts): update to eslint 9
2 parents b3ec0ed + c8cdf6d commit 0fb9a47

File tree

2 files changed

+56
-7
lines changed

2 files changed

+56
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import typescriptEslint from '@typescript-eslint/eslint-plugin';
2+
import promise from 'eslint-plugin-promise';
3+
import tsParser from '@typescript-eslint/parser';
4+
import js from '@eslint/js';
5+
import {FlatCompat} from '@eslint/eslintrc';
6+
7+
const compat = new FlatCompat({
8+
// baseDirectory: import.meta.dirname,
9+
recommendedConfig: js.configs.recommended,
10+
allConfig: js.configs.all,
11+
});
12+
13+
export default [
14+
...compat.extends(
15+
'eslint:recommended',
16+
'plugin:@typescript-eslint/recommended'
17+
),
18+
{
19+
plugins: {
20+
'@typescript-eslint': typescriptEslint,
21+
promise,
22+
},
23+
24+
languageOptions: {
25+
parser: tsParser,
26+
ecmaVersion: 2022,
27+
sourceType: 'script',
28+
29+
parserOptions: {
30+
project: ['./tsconfig.json'],
31+
},
32+
},
33+
34+
rules: {
35+
'quotes': [2, 'single', 'avoid-escape'],
36+
'no-console': 'error',
37+
'camelcase': 2,
38+
'promise/catch-or-return': 'error',
39+
'promise/prefer-await-to-then': 'error',
40+
'promise/prefer-await-to-callbacks': 'warn',
41+
'promise/always-return': 'error',
42+
'@typescript-eslint/no-inferrable-types': 'off',
43+
'@typescript-eslint/no-floating-promises': 'error',
44+
'no-implicit-coercion': [2],
45+
'@typescript-eslint/no-explicit-any': 'off',
46+
},
47+
48+
ignores: ['dist/', 'node_modules/', '**/*.js', '**/*.mjs'],
49+
},
50+
];

packages/eslint-config-ts/package.json

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dotmh/eslint-config-ts",
3-
"version": "2.0.0",
3+
"version": "3.0.0",
44
"description": "A ESLint file for all DotMH Typescript projects",
55
"main": "index.js",
66
"scripts": {
@@ -23,12 +23,11 @@
2323
"url": "https://github.com/dotmh/eslint-config-ts/issues"
2424
},
2525
"homepage": "https://github.com/dotmh/eslint-config-ts#readme",
26-
"dependencies": {
27-
"@typescript-eslint/parser": "^5.17.0"
28-
},
26+
"dependencies": {},
2927
"peerDependencies": {
30-
"eslint": ">8.7.0",
31-
"@typescript-eslint/eslint-plugin": ">5.2.0",
32-
"eslint-plugin-promise": ">5.1.1"
28+
"eslint": "^9.16.0",
29+
"eslint-plugin-promise": "^7.2.1",
30+
"@typescript-eslint/eslint-plugin": "^8.17.0",
31+
"@typescript-eslint/parser": "^8.17.0"
3332
}
3433
}

0 commit comments

Comments
 (0)