Skip to content

Commit 45cb4db

Browse files
Simplified ESLint patch
1 parent 1a97ba4 commit 45cb4db

File tree

6 files changed

+883
-537
lines changed

6 files changed

+883
-537
lines changed

eslint-config-ringcentral-typescript/README.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ A stricter and TypeScript-enabled version of https://github.com/ringcentral/ring
66
## Installation
77

88
```bash
9-
$ npm install eslint eslint-config-ringcentral-typescript --save-dev
9+
$ npm install eslint eslint-config-ringcentral-typescript @rushstack/eslint-patch --save-dev
1010
```
1111

12+
:warning: Don't forget to install `@rushstack/eslint-patch`!
13+
1214
Add this to `scripts` section of `package.json`:
1315

1416
```json
@@ -25,16 +27,20 @@ You can add `DEBUG=eslint:cli-engine` to output files that were linted.
2527

2628
:warning: Please note commas around globs: `'src/**/*.ts'`, this will prevent your OS to expand those globs.
2729

28-
Create `.eslintrc`:
30+
Create `.eslintrc.js`:
2931

30-
```json
31-
{
32+
```js
33+
require('@rushstack/eslint-patch/modern-module-resolution');
34+
35+
module.exports = {
3236
"extends": [
3337
"ringcentral-typescript"
3438
]
3539
}
3640
```
3741

42+
:warning: Don't forget to add `require('@rushstack/eslint-patch/modern-module-resolution');`!
43+
3844
Create `.prettierrc` (optional):
3945

4046
```bash

eslint-config-ringcentral-typescript/package.json

+16-18
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,37 @@
33
"version": "1.0.0",
44
"description": "",
55
"main": "src/index.js",
6-
"bin": {
7-
"rc-eslint-patch": "./src/bin/rc-eslint-patch.js"
8-
},
96
"scripts": {
107
"test": "yarn lint 'src/**/*.{js*,ts*}'",
118
"lint": "eslint --cache --cache-location .eslint/cache --fix --quiet"
129
},
1310
"dependencies": {
14-
"@typescript-eslint/eslint-plugin": "4.4.1",
15-
"@typescript-eslint/parser": "4.4.1",
11+
"@typescript-eslint/eslint-plugin": "^4.0.0",
12+
"@typescript-eslint/parser": "^4.0.0",
1613
"babel-eslint": "10.1.0",
17-
"eslint": "7.11.0",
18-
"eslint-config-prettier": "6.12.0",
19-
"eslint-config-react-app": "5.2.1",
14+
"eslint-config-prettier": "7.1.0",
15+
"eslint-config-react-app": "6.0.0",
2016
"eslint-config-ringcentral": "1.0.0",
2117
"eslint-import-resolver-node": "0.3.4",
22-
"eslint-plugin-flowtype": "5.2.0",
23-
"eslint-plugin-import": "2.22.1",
24-
"eslint-plugin-jsx-a11y": "6.3.1",
25-
"eslint-plugin-prettier": "3.1.4",
26-
"eslint-plugin-react": "7.21.4",
27-
"eslint-plugin-react-hooks": "4.1.2",
18+
"eslint-plugin-flowtype": "^5.2.0",
19+
"eslint-plugin-import": "^2.22.0",
20+
"eslint-plugin-jest": "^24.0.0",
21+
"eslint-plugin-jsx-a11y": "^6.3.1",
22+
"eslint-plugin-react": "^7.20.3",
23+
"eslint-plugin-react-hooks": "^4.0.8",
24+
"eslint-plugin-testing-library": "^3.9.0",
2825
"eslint-plugin-ringcentral": "1.0.0",
2926
"eslint-plugin-sonarjs": "0.5.0",
30-
"prettier": "2.1.2",
31-
"typescript": "4.0.3"
27+
"prettier": "2.2.1"
3228
},
3329
"peerDependencies": {
34-
"eslint": "7.11.0",
30+
"eslint": "*",
3531
"typescript": "*"
3632
},
3733
"devDependencies": {
38-
"react": "^16.13.1"
34+
"eslint": "7.17.0",
35+
"react": "16.13.1",
36+
"typescript": "4.0.3"
3937
},
4038
"repository": {
4139
"type": "git",

eslint-config-ringcentral-typescript/src/bin/rc-eslint-patch.js

-16
This file was deleted.

eslint-config-ringcentral-typescript/src/bin/rc-eslint.js

-4
This file was deleted.

eslint-config-ringcentral-typescript/src/config.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// require("@rushstack/eslint-patch/modern-module-resolution");
2+
13
module.exports = {
24
root: true,
35
plugins: ['prettier'], //FIXME [UIA-10000] Remove
@@ -15,7 +17,7 @@ module.exports = {
1517
'plugin:import/typescript',
1618
],
1719
rules: {
18-
'curly': 'error',
20+
curly: 'error',
1921
'prettier/prettier': [
2022
'error',
2123
{

0 commit comments

Comments
 (0)