Skip to content

Commit f68dd93

Browse files
author
Robert S
committed
update eslint with typescript and packages
1 parent 801883c commit f68dd93

File tree

6 files changed

+528
-459
lines changed

6 files changed

+528
-459
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tools/**

.eslintrc.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// https://www.robertcooper.me/using-eslint-and-prettier-in-a-typescript-project
2+
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin/docs/rules
3+
4+
module.exports = {
5+
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
6+
extends: [
7+
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
8+
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from @typescript-eslint/eslint-plugin
9+
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
10+
// Make sure this is always the last configuration in the extends array.
11+
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors.
12+
],
13+
parserOptions: {
14+
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
15+
sourceType: 'module', // Allows for the use of imports
16+
ecmaFeatures: {
17+
jsx: true, // Allows for the parsing of JSX
18+
},
19+
},
20+
rules: {
21+
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
22+
// 0 = off, 1 = warn, 2 = error
23+
'@typescript-eslint/interface-name-prefix': 0,
24+
'@typescript-eslint/no-empty-interface': 0,
25+
'@typescript-eslint/no-unused-vars': 0,
26+
'@typescript-eslint/no-explicit-any': 0,
27+
'@typescript-eslint/no-inferrable-types': 0,
28+
'@typescript-eslint/no-non-null-assertion': 0,
29+
'@typescript-eslint/explicit-function-return-type': 0,
30+
},
31+
settings: {
32+
react: {
33+
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
34+
},
35+
},
36+
};

package.json

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "react-typescript",
3-
"homepage": "https://codebelt.github.io/react-redux-architecture",
43
"version": "0.1.0",
54
"private": true,
65
"husky": {
@@ -17,15 +16,11 @@
1716
"prod": "cross-env CLIENT_ENV=production craco start",
1817
"---------- PRODUCTION ----------------------------------------------------------------------------------": "",
1918
"build": "cross-env CLIENT_ENV=production craco build",
20-
"---------- Github Deploy -------------------------------------------------------------------------------": "",
21-
"predeploy": "yarn build",
22-
"deploy": "gh-pages -d build",
2319
"---------- TESTING -------------------------------------------------------------------------------------": "",
2420
"test": "cross-env CLIENT_ENV=test craco test",
2521
"type-check": "tsc --noEmit",
2622
"type-check:watch": "npm run type-check -- --watch",
27-
"lint": "tslint --project . --config tslint.json",
28-
"lint:fix": "tslint --project . --config tslint.json --fix",
23+
"lint": "eslint 'src/**/*.{js,ts,tsx}' --fix",
2924
"--------------------------------------------------------------------------------------------------------": ""
3025
},
3126
"eslintConfig": {
@@ -50,10 +45,10 @@
5045
"dayjs": "1.8.16",
5146
"history": "4.10.1",
5247
"lodash.groupby": "4.6.0",
53-
"react": "16.9.0",
54-
"react-dom": "16.9.0",
48+
"react": "16.11.0",
49+
"react-dom": "16.11.0",
5550
"react-redux": "7.1.1",
56-
"react-router-dom": "5.0.1",
51+
"react-router-dom": "5.1.2",
5752
"redux": "4.0.4",
5853
"redux-devtools-extension": "2.13.8",
5954
"redux-freeze": "0.1.7",
@@ -66,28 +61,29 @@
6661
"uuid": "3.3.3"
6762
},
6863
"devDependencies": {
69-
"@craco/craco": "5.5.0",
64+
"@craco/craco": "5.6.1",
7065
"@types/classnames": "2.2.9",
7166
"@types/history": "4.7.3",
72-
"@types/jest": "24.0.18",
73-
"@types/node": "12.7.5",
74-
"@types/react": "16.9.2",
75-
"@types/react-dom": "16.9.0",
76-
"@types/react-redux": "7.1.2",
77-
"@types/react-router-dom": "4.3.5",
78-
"@types/uuid": "3.4.5",
79-
"cross-env": "6.0.0",
67+
"@types/jest": "24.0.21",
68+
"@types/node": "12.12.5",
69+
"@types/react": "16.9.11",
70+
"@types/react-dom": "16.9.3",
71+
"@types/react-redux": "7.1.5",
72+
"@types/react-router-dom": "5.1.2",
73+
"@types/uuid": "3.4.6",
74+
"@typescript-eslint/eslint-plugin": "2.6.1",
75+
"@typescript-eslint/parser": "2.6.1",
76+
"cross-env": "6.0.3",
77+
"eslint": "6.6.0",
78+
"eslint-config-prettier": "6.5.0",
79+
"eslint-plugin-prettier": "3.1.1",
80+
"eslint-plugin-react": "7.16.0",
8081
"generate-template-files": "2.2.0",
81-
"gh-pages": "2.1.1",
82-
"husky": "3.0.5",
83-
"node-sass": "4.12.0",
82+
"husky": "3.0.9",
83+
"node-sass": "4.13.0",
8484
"prettier": "1.18.2",
85-
"pretty-quick": "1.11.1",
86-
"react-scripts": "3.1.2",
87-
"tslint": "5.20.0",
88-
"tslint-config-prettier": "1.18.0",
89-
"tslint-eslint-rules": "5.4.0",
90-
"tslint-react": "4.1.0",
91-
"typescript": "3.6.3"
85+
"pretty-quick": "2.0.0",
86+
"react-scripts": "3.2.0",
87+
"typescript": "3.6.4"
9288
}
9389
}

src/serviceWorker.js

Lines changed: 0 additions & 122 deletions
This file was deleted.

tslint.json

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)