Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 74f9786

Browse files
committedJul 21, 2022
Adapt for typescript projects
1 parent 66564ff commit 74f9786

File tree

4 files changed

+1837
-118
lines changed

4 files changed

+1837
-118
lines changed
 

‎.eslintrc.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "./index.js"
3+
}

‎index.js

+45-32
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,48 @@
11
module.exports = {
2-
root: true,
3-
4-
overrides: [
5-
{
6-
files: ['**/*.{ts,tsx}'],
7-
settings: {
8-
// Allow importing more file types
9-
'import/resolver': {
10-
node: {
11-
extensions: [
12-
'.ts',
13-
'.tsx',
14-
'.json',
15-
],
16-
},
17-
},
18-
},
19-
20-
extends: ['airbnb', 'airbnb-typescript', 'plugin:react/jsx-runtime'],
21-
parser: '@typescript-eslint/parser',
22-
env: {
23-
browser: true,
24-
node: true,
25-
jest: true,
26-
},
27-
28-
rules: {
29-
'@typescript-eslint/no-use-before-define': ['error', { functions: false }],
30-
'object-curly-newline': ['error', { multiline: true }],
31-
'import/extensions': 'off',
32-
},
2+
extends: [
3+
'@pluralsh/eslint-config-pluralsh',
4+
'plugin:@typescript-eslint/eslint-recommended',
5+
'plugin:@typescript-eslint/recommended',
6+
],
7+
parser: '@typescript-eslint/parser',
8+
parserOptions: {
9+
parser: '@babel/eslint-parser',
10+
requireConfigFile: false,
11+
sourceType: 'module',
12+
babelOptions: {
13+
presets: [
14+
'@babel/preset-env',
15+
'@babel/preset-react',
16+
],
17+
},
18+
},
19+
settings: {
20+
react: {
21+
version: 'detect',
3322
},
23+
},
24+
env: {
25+
browser: true,
26+
es2021: true,
27+
},
28+
globals: {
29+
JSX: true,
30+
jest: true,
31+
},
32+
plugins: [
33+
'@typescript-eslint',
3434
],
35-
};
35+
rules: {
36+
'react/jsx-no-bind': 'off',
37+
'react/require-default-props': 'off',
38+
'react/destructuring-assignment': 'off',
39+
'no-unused-vars': 'off',
40+
'import/no-unresolved': 'off',
41+
'import/extensions': 'off',
42+
'import/no-extraneous-dependencies': 'off',
43+
'@typescript-eslint/no-explicit-any': 'off',
44+
'@typescript-eslint/no-empty-function': 'off',
45+
'@typescript-eslint/ban-ts-comment': 'off',
46+
'@typescript-eslint/no-non-null-assertion': 'off',
47+
},
48+
}

‎package.json

+14-21
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pluralsh/eslint-config-typescript",
3-
"version": "1.2.0",
3+
"version": "2.0.0",
44
"description": "A modern eslint typescript configuration",
55
"author": "Plural (https://plural.sh)",
66
"license": "MIT",
@@ -14,29 +14,22 @@
1414
},
1515
"keywords": [
1616
"eslint",
17-
"typescript"
17+
"typescript",
18+
"plural",
19+
"pluralsh"
1820
],
1921
"main": "index.js",
2022
"packageManager": "yarn@3.2.1",
21-
"peerDependencies": {
22-
"eslint": ">= 8.19.0",
23-
"eslint-plugin-import": ">= 2.26.0",
24-
"eslint-plugin-jsx-a11y": ">= 6.5.1",
25-
"eslint-plugin-react": ">= 7.29.4",
26-
"eslint-plugin-react-hooks": ">= 4.4.0",
27-
"typescript": ">= 4.7.4"
28-
},
2923
"dependencies": {
30-
"@typescript-eslint/eslint-plugin": "5.30.7",
31-
"@typescript-eslint/parser": "5.30.7",
32-
"eslint": "8.20.0",
33-
"eslint-config-airbnb": "19.0.4",
34-
"eslint-config-airbnb-typescript": "17.0.0",
35-
"eslint-plugin-import": "2.26.0",
36-
"eslint-plugin-jsx-a11y": "6.6.1",
37-
"eslint-plugin-react": "7.30.1",
38-
"eslint-plugin-react-hooks": "4.6.0",
39-
"semver": "7.3.7",
40-
"typescript": "4.7.4"
24+
"@babel/core": "^7.18.9",
25+
"@babel/eslint-parser": "^7.18.9",
26+
"@babel/preset-env": "^7.18.9",
27+
"@babel/preset-react": "^7.18.6",
28+
"@pluralsh/eslint-config-pluralsh": "^1.0.0",
29+
"@types/node": "^18.0.6",
30+
"@typescript-eslint/eslint-plugin": "^5.30.7",
31+
"@typescript-eslint/parser": "^5.30.7",
32+
"eslint": "^8.20.0",
33+
"typescript": "^4.7.4"
4134
}
4235
}

‎yarn.lock

+1,775-65
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.