Skip to content

Commit 587fdff

Browse files
authored
Feature/eslint next config (#19)
* ✨ Next.js config support * 3.0.0
1 parent 8d2ef8d commit 587fdff

File tree

8 files changed

+86
-18
lines changed

8 files changed

+86
-18
lines changed

Diff for: README.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ _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.
7+
The package contains our ESLint rules, including Next.js, ES6, React & TypeScript.
88

99
> 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
@@ -13,14 +13,14 @@ The package contains our ESLint rules, including ES6, React & TypeScript.
1313
### Installation
1414

1515
```
16-
yarn add --dev @codit/eslint-config eslint@^7.2.0 @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 eslint-plugin-jsx-a11y@^6.4.1
16+
yarn add --dev @codit/eslint-config eslint@8.22.0
1717
```
1818

1919
### Configuration
2020

21-
The following configuration contains a setup for ES6, React, TypeScript & Prettier, add it to your `.eslintrc` file
21+
The following configuration contains a setup for Next.js, ES6, React, TypeScript & Prettier, add it to your `.eslintrc` file
2222

23-
```javascript
23+
```json
2424
"extends": ["@codit"]
2525
```
2626

@@ -37,14 +37,15 @@ Or if you want to take more control or don't use TypeScript, you can also extend
3737

3838
"extends": [
3939
"@codit/eslint-config/core",
40-
"@codit/eslint-config/es5"
40+
"@codit/eslint-config/next"
4141
]
4242
```
4343

4444
## Older versions
4545

46-
Documentation for versions 1.x.x can be found in the docs folder:
46+
Documentation for older versions can be found in the docs folder:
4747

48+
- [Version 2.x.x](./docs/version-2.x.x.md)
4849
- [Version 1.x.x](./docs/version-1.x.x.md)
4950

5051
## License

Diff for: docs/version-2.x.x.md

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Codit ESLint Config
2+
3+
_A fair-minded way to reduce noise in Javascript_
4+
5+
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.
6+
7+
The package contains our ESLint rules, including ES6, React & TypeScript.
8+
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.
10+
11+
## Usage
12+
13+
### Installation
14+
15+
```
16+
yarn add --dev @codit/eslint-config eslint@^7.2.0 @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 eslint-plugin-jsx-a11y@^6.4.1
17+
```
18+
19+
### Configuration
20+
21+
The following configuration contains a setup for ES6, React, TypeScript & Prettier, add it to your `.eslintrc` file
22+
23+
```javascript
24+
"extends": ["@codit"]
25+
```
26+
27+
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):
28+
29+
```javascript
30+
31+
"extends": [
32+
"@codit/eslint-config/core",
33+
"@codit/eslint-config/react"
34+
]
35+
36+
// or
37+
38+
"extends": [
39+
"@codit/eslint-config/core",
40+
"@codit/eslint-config/es5"
41+
]
42+
```
43+
44+
## Older versions
45+
46+
Documentation for versions 1.x.x can be found in the docs folder:
47+
48+
- [Version 1.x.x](version-1.x.x.md)
49+
50+
## License
51+
52+
[MIT](../LICENSE)

Diff for: next.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./packages/next.json');

Diff for: package.json

+16-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codit/eslint-config",
3-
"version": "2.0.8",
3+
"version": "3.0.0",
44
"description": "Codit's shareable EsLint configuration",
55
"main": "index.js",
66
"repository": {
@@ -16,24 +16,29 @@
1616
"codit"
1717
],
1818
"author": "Erwin Govaerts <[email protected]>",
19+
"contributors": [
20+
"Michael Calewaert <[email protected]>"
21+
],
1922
"license": "MIT",
2023
"dependencies": {
2124
"@babel/eslint-parser": "^7.12.17",
22-
"@typescript-eslint/parser": "^4.15.2",
23-
"eslint-config-prettier": "^8.0.0"
24-
},
25-
"devDependencies": {
26-
"typescript": "^4.1.2"
27-
},
28-
"peerDependencies": {
29-
"@babel/eslint-plugin": "^7.13.0",
30-
"@typescript-eslint/eslint-plugin": "^4.15.2",
31-
"eslint": "^7.20.0",
25+
"@babel/eslint-plugin": "^7.12.17",
26+
"@typescript-eslint/eslint-plugin": "^5.44.0",
27+
"@typescript-eslint/parser": "^5.44.0",
28+
"eslint-config-next": "13.0.5",
29+
"eslint-config-prettier": "^8.0.0",
30+
"eslint-import-resolver-typescript": "^3.5.2",
3231
"eslint-plugin-filenames": "^1.3.2",
3332
"eslint-plugin-import": "^2.22.1",
3433
"eslint-plugin-jsx-a11y": "^6.4.1",
3534
"eslint-plugin-promise": "^4.3.1",
3635
"eslint-plugin-react": "^7.22.0",
3736
"eslint-plugin-react-hooks": "^4.2.0"
37+
},
38+
"devDependencies": {
39+
"typescript": "^4.1.2"
40+
},
41+
"peerDependencies": {
42+
"eslint": "8.22.0"
3843
}
3944
}

Diff for: packages/base.json

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"./packages/react",
55
"./packages/jsx-a11y",
66
"./packages/typescript",
7+
"./packages/next",
78
"prettier"
89
]
910
}

Diff for: packages/next.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends":"plugin:@next/next/recommended"
3+
}

Diff for: packages/react.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
}
104104
],
105105
"react/prop-types": 0,
106-
"react/react-in-jsx-scope": 2,
106+
"react/react-in-jsx-scope": 0,
107107
"react/jsx-closing-tag-location": 0,
108108
"react/no-redundant-should-component-update": 2,
109109
"react/require-default-props": 0,

Diff for: packages/typescript.json

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
"import/resolver": {
1212
"node": {
1313
"extensions": [".js", ".jsx", ".ts", ".tsx", ".json"]
14+
},
15+
"typescript": {
16+
"alwaysTryTypes": true,
17+
"project":"./tsconfig.json"
18+
1419
}
1520
},
1621
"import/extensions": [".js", ".jsx", ".ts", ".tsx"]

0 commit comments

Comments
 (0)