Skip to content

Commit a0fbd0b

Browse files
committed
Disable some incompatible rules and fix typescript support
1 parent 5647b53 commit a0fbd0b

File tree

3 files changed

+60
-29
lines changed

3 files changed

+60
-29
lines changed

index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const config: BaseConfig = {
77
extends: [
88
"plugin:@typescript-eslint/recommended",
99
"airbnb-typescript/base",
10+
"plugin:import/typescript",
1011
// "standard-with-typescript", -- not avilable for @typescript-eslint/eslint-plugin v5 yet
1112
],
1213
// eslint-plugins
@@ -15,10 +16,23 @@ const config: BaseConfig = {
1516
// Enabling/disabling/changing level of rules
1617
rules: {
1718
"@typescript-eslint/no-non-null-assertion": "off",
19+
"no-negated-condition": "off",
20+
"import/no-unresolved": "error",
1821
},
1922
parserOptions: {
2023
project: "./tsconfig.json",
2124
},
25+
settings: {
26+
"import/parsers": {
27+
"@typescript-eslint/parser": [".ts", ".tsx"],
28+
},
29+
"import/resolver": {
30+
typescript: {
31+
// Always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
32+
alwaysTryTypes: true,
33+
},
34+
},
35+
},
2236
};
2337

2438
module.exports = config;

package-lock.json

Lines changed: 44 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-config-pythoncoderas-typescript",
3-
"version": "1.0.0",
3+
"version": "2.0.0",
44
"description": "My reusable eslint config for typescript projects.",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -34,6 +34,7 @@
3434
"@types/node": "^17.0.41",
3535
"eslint": "^8.17.0",
3636
"eslint-config-pythoncoderas": "^2.0.0",
37+
"eslint-import-resolver-typescript": "^2.7.1",
3738
"prettier": "^2.6.2"
3839
},
3940
"dependencies": {

0 commit comments

Comments
 (0)