Skip to content

Commit

Permalink
Merge pull request #13 from CoditEU/feature/remove-deps-and-cleanup
Browse files Browse the repository at this point in the history
Feature/remove deps and cleanup
  • Loading branch information
THMKAE authored Mar 3, 2021
2 parents 3958ff9 + f1f4d7c commit 397d9a7
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 213 deletions.
43 changes: 17 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,47 @@ _A fair-minded way to reduce noise in Javascript_

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.

The package contains our ESLint rules, including ES6, React, TypeScript, FlowType & Lodash.
The package contains our ESLint rules, including ES6, React & TypeScript.

> 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.
> 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.
## Usage

### Installation

```
yarn add @codit/eslint-config eslint@^6.8.0 --dev
yarn add @codit/eslint-config eslint@^7.2.0 --dev
```

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

```
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
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
```

### Configuration

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

```
"eslintConfig": {
"extends": [
"@codit"
]
}
"extends": ["@codit"]
```

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):
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):

```
"eslintConfig": {
"extends": [
"@codit/core",
"@codit/flowtype",
"@codit/lodash",
"@codit/react"
]
}
"extends": [
"@codit/eslint-config/core",
"@codit/eslint-config/react"
]
// or
"eslintConfig": {
"extends": [
"@codit/core",
"@codit/es5"
]
}
"extends": [
"@codit/eslint-config/core",
"@codit/eslint-config/es5"
]
```

## Older versions
Expand Down
1 change: 0 additions & 1 deletion flowtype.js

This file was deleted.

1 change: 0 additions & 1 deletion lodash.js

This file was deleted.

28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@
],
"author": "Erwin Govaerts <[email protected]>",
"license": "MIT",
"dependencies": {
"@babel/eslint-parser": "^7.12.17",
"@typescript-eslint/parser": "^4.15.2",
"eslint-config-prettier": "^8.0.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.1.1",
"@typescript-eslint/parser": "^4.1.1",
"babel-eslint": "^10.0.3",
"eslint-config-prettier": "^6.9.0",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-filenames": "^1.3.2",
"eslint-plugin-flowtype": "^4.5.3",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-lodash": "^6.0.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.17.0",
"eslint-plugin-react-hooks": "^4.1.2",
"typescript": "^4.0.3"
"typescript": "^4.1.2"
},
"peerDependencies": {
"eslint": "^7.8.1"
"@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"
}
}
4 changes: 1 addition & 3 deletions packages/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"./packages/core",
"./packages/react",
"./packages/typescript",
"prettier",
"prettier/@typescript-eslint",
"prettier/react"
"prettier"
]
}
10 changes: 5 additions & 5 deletions packages/core.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"es6": true,
"node": true
},
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
Expand All @@ -16,7 +16,7 @@
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["babel", "import", "promise", "filenames"],
"plugins": ["@babel", "import", "promise", "filenames"],
"rules": {
"accessor-pairs": 2,
"array-bracket-spacing": [2, "never"],
Expand All @@ -31,9 +31,9 @@
"before": true
}
],
"babel/new-cap": 1,
"babel/no-invalid-this": 2,
"babel/object-curly-spacing": [2, "always"],
"@babel/new-cap": 1,
"@babel/no-invalid-this": 2,
"@babel/object-curly-spacing": [2, "always"],
"block-scoped-var": 2,
"block-spacing": [2, "always"],
"brace-style": [
Expand Down
88 changes: 0 additions & 88 deletions packages/flowtype.json

This file was deleted.

74 changes: 0 additions & 74 deletions packages/lodash.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/typescript.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"plugins": ["@typescript-eslint"],
"plugins": ["@typescript-eslint", "import"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
Expand Down
1 change: 1 addition & 0 deletions typescript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("./packages/typescript.json");

0 comments on commit 397d9a7

Please sign in to comment.