Skip to content

Commit 397d9a7

Browse files
authored
Merge pull request #13 from CoditEU/feature/remove-deps-and-cleanup
Feature/remove deps and cleanup
2 parents 3958ff9 + f1f4d7c commit 397d9a7

10 files changed

+39
-213
lines changed

README.md

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,56 +4,47 @@ _A fair-minded way to reduce noise in Javascript_
44

55
The goal of this package is to have a consistent coding style across multiple files / projects while not being overly strict and have a minimal setup procedure.
66

7-
The package contains our ESLint rules, including ES6, React, TypeScript, FlowType & Lodash.
7+
The package contains our ESLint rules, including ES6, React & TypeScript.
88

9-
> Note: We also use [Prettier](https://github.com/prettier/prettier) as a precommit hook, together with their [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier), so we might not meet your standards on indentation etc. If you do need it, you can always override the configuration with extra rules. See [Configuring ESLint](https://eslint.org/docs/user-guide/configuring) for more information.
9+
> Note: We also use [Prettier](https://github.com/prettier/prettier) and integrated [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) within this package, so we might not meet your standards on indentation etc. If needed, you can always override the configuration with extra rules. See [Configuring ESLint](https://eslint.org/docs/user-guide/configuring) for more information.
1010
1111
## Usage
1212

1313
### Installation
1414

1515
```
16-
yarn add @codit/eslint-config eslint@^6.8.0 --dev
16+
yarn add @codit/eslint-config eslint@^7.2.0 --dev
1717
```
1818

19-
Install dependencies. ESLint plugins [must also be installed](https://github.com/eslint/rfcs/pull/5).
19+
Install peer dependencies.
2020

2121
```
22-
yarn add -D eslint-plugin-babel@^5.3.0 eslint-plugin-filenames@^1.3.2 eslint-plugin-import@^2.19.1 eslint-plugin-promise@^4.2.1 eslint-plugin-react@^7.17.0 eslint-config-prettier@^6.9.0
22+
yarn add --dev @babel/eslint-plugin@^7.13.0 @typescript-eslint/eslint-plugin@^4.15.2 eslint@^7.20.0 eslint-plugin-filenames@^1.3.2 eslint-plugin-import@^2.22.1 eslint-plugin-promise@^4.3.1 eslint-plugin-react@^7.22.0 eslint-plugin-react-hooks@^4.2.0
2323
```
2424

2525
### Configuration
2626

27-
The following configuration contains a setup for ES6, React, TypeScript & Prettier
27+
The following configuration contains a setup for ES6, React, TypeScript & Prettier, add it to your `.eslintrc` file
2828

2929
```
30-
"eslintConfig": {
31-
"extends": [
32-
"@codit"
33-
]
34-
}
30+
"extends": ["@codit"]
3531
```
3632

37-
Or if you want to take more control or don't use TypeScript, you can also extend the packages as follows (make sure to also install the correct dependencies, FlowType & Lodash f.e. are not listed in the step above):
33+
Or if you want to take more control or don't use TypeScript, you can also extend the packages as follows (make sure to also install the correct dependencies):
3834

3935
```
40-
"eslintConfig": {
41-
"extends": [
42-
"@codit/core",
43-
"@codit/flowtype",
44-
"@codit/lodash",
45-
"@codit/react"
46-
]
47-
}
36+
37+
"extends": [
38+
"@codit/eslint-config/core",
39+
"@codit/eslint-config/react"
40+
]
4841
4942
// or
5043
51-
"eslintConfig": {
52-
"extends": [
53-
"@codit/core",
54-
"@codit/es5"
55-
]
56-
}
44+
"extends": [
45+
"@codit/eslint-config/core",
46+
"@codit/eslint-config/es5"
47+
]
5748
```
5849

5950
## Older versions

flowtype.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

lodash.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,22 @@
1717
],
1818
"author": "Erwin Govaerts <[email protected]>",
1919
"license": "MIT",
20+
"dependencies": {
21+
"@babel/eslint-parser": "^7.12.17",
22+
"@typescript-eslint/parser": "^4.15.2",
23+
"eslint-config-prettier": "^8.0.0"
24+
},
2025
"devDependencies": {
21-
"@typescript-eslint/eslint-plugin": "^4.1.1",
22-
"@typescript-eslint/parser": "^4.1.1",
23-
"babel-eslint": "^10.0.3",
24-
"eslint-config-prettier": "^6.9.0",
25-
"eslint-plugin-babel": "^5.3.0",
26-
"eslint-plugin-filenames": "^1.3.2",
27-
"eslint-plugin-flowtype": "^4.5.3",
28-
"eslint-plugin-import": "^2.22.0",
29-
"eslint-plugin-lodash": "^6.0.0",
30-
"eslint-plugin-promise": "^4.2.1",
31-
"eslint-plugin-react": "^7.17.0",
32-
"eslint-plugin-react-hooks": "^4.1.2",
33-
"typescript": "^4.0.3"
26+
"typescript": "^4.1.2"
3427
},
3528
"peerDependencies": {
36-
"eslint": "^7.8.1"
29+
"@babel/eslint-plugin": "^7.13.0",
30+
"@typescript-eslint/eslint-plugin": "^4.15.2",
31+
"eslint": "^7.20.0",
32+
"eslint-plugin-filenames": "^1.3.2",
33+
"eslint-plugin-import": "^2.22.1",
34+
"eslint-plugin-promise": "^4.3.1",
35+
"eslint-plugin-react": "^7.22.0",
36+
"eslint-plugin-react-hooks": "^4.2.0"
3737
}
3838
}

packages/base.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
"./packages/core",
44
"./packages/react",
55
"./packages/typescript",
6-
"prettier",
7-
"prettier/@typescript-eslint",
8-
"prettier/react"
6+
"prettier"
97
]
108
}

packages/core.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"es6": true,
66
"node": true
77
},
8-
"parser": "babel-eslint",
8+
"parser": "@babel/eslint-parser",
99
"parserOptions": {
1010
"ecmaFeatures": {
1111
"experimentalObjectRestSpread": true,
@@ -16,7 +16,7 @@
1616
"ecmaVersion": 2018,
1717
"sourceType": "module"
1818
},
19-
"plugins": ["babel", "import", "promise", "filenames"],
19+
"plugins": ["@babel", "import", "promise", "filenames"],
2020
"rules": {
2121
"accessor-pairs": 2,
2222
"array-bracket-spacing": [2, "never"],
@@ -31,9 +31,9 @@
3131
"before": true
3232
}
3333
],
34-
"babel/new-cap": 1,
35-
"babel/no-invalid-this": 2,
36-
"babel/object-curly-spacing": [2, "always"],
34+
"@babel/new-cap": 1,
35+
"@babel/no-invalid-this": 2,
36+
"@babel/object-curly-spacing": [2, "always"],
3737
"block-scoped-var": 2,
3838
"block-spacing": [2, "always"],
3939
"brace-style": [

packages/flowtype.json

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

packages/lodash.json

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

packages/typescript.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"plugins": ["@typescript-eslint"],
2+
"plugins": ["@typescript-eslint", "import"],
33
"parser": "@typescript-eslint/parser",
44
"parserOptions": {
55
"project": "./tsconfig.json"

typescript.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require("./packages/typescript.json");

0 commit comments

Comments
 (0)