@nihalgonsalves/esconfig 0.0.6 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +18 -0
- package/.eslintrc.react.js +15 -0
- package/CHANGELOG.md +22 -0
- package/README.md +12 -1
- package/eslint-rules-base.js +59 -0
- package/package.json +22 -20
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
/** @type import('eslint-define-config').EslintConfig */
|
|
4
|
+
module.exports = {
|
|
5
|
+
parser: '@typescript-eslint/parser',
|
|
6
|
+
plugins: ['@typescript-eslint', 'import'],
|
|
7
|
+
parserOptions: {
|
|
8
|
+
project: './**/tsconfig*.json',
|
|
9
|
+
},
|
|
10
|
+
extends: [
|
|
11
|
+
'airbnb-typescript/base',
|
|
12
|
+
'plugin:@typescript-eslint/recommended',
|
|
13
|
+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
14
|
+
'prettier',
|
|
15
|
+
'plugin:import/typescript',
|
|
16
|
+
],
|
|
17
|
+
rules: require('./eslint-rules-base'),
|
|
18
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
/** @type import('eslint-define-config').EslintConfig */
|
|
4
|
+
module.exports = {
|
|
5
|
+
extends: ['airbnb-typescript', 'airbnb/hooks', 'prettier'],
|
|
6
|
+
rules: {
|
|
7
|
+
...require('./eslint-rules-base'),
|
|
8
|
+
'react/state-in-constructor': ['error', 'never'],
|
|
9
|
+
'react/static-property-placement': ['error', 'static public field'],
|
|
10
|
+
'react/react-in-jsx-scope': 'off',
|
|
11
|
+
// Not a problem with TypeScript
|
|
12
|
+
'react/jsx-props-no-spreading': 'off',
|
|
13
|
+
'react/require-default-props': 'off',
|
|
14
|
+
},
|
|
15
|
+
};
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [0.1.0](https://github.com/nihalgonsalves/esconfig/compare/v0.0.9...v0.1.0) (2021-12-29)
|
|
6
|
+
|
|
7
|
+
### ⚠ BREAKING CHANGES
|
|
8
|
+
|
|
9
|
+
- eslint v8, node v16
|
|
10
|
+
|
|
11
|
+
- empty commit for version bump ([0868bd0](https://github.com/nihalgonsalves/esconfig/commit/0868bd0467e6ae088413a725663afbd451e44347))
|
|
12
|
+
|
|
13
|
+
### [0.0.9](https://github.com/nihalgonsalves/esconfig/compare/v0.0.8...v0.0.9) (2021-05-12)
|
|
14
|
+
|
|
15
|
+
### [0.0.8](https://github.com/nihalgonsalves/esconfig/compare/v0.0.7...v0.0.8) (2021-04-25)
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
- **eslint:** add overrides to react config too ([8dfa82d](https://github.com/nihalgonsalves/esconfig/commit/8dfa82d9c202de3fca1f02b79217f0be36353e5b))
|
|
20
|
+
|
|
21
|
+
### [0.0.7](https://github.com/nihalgonsalves/esconfig/compare/v0.0.6...v0.0.7) (2021-04-25)
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
- publish eslint again ([5e49474](https://github.com/nihalgonsalves/esconfig/commit/5e4947400a6ea05efbeeec4db744a98a6c16adc4))
|
|
26
|
+
|
|
5
27
|
### [0.0.6](https://github.com/nihalgonsalves/esconfig/compare/v0.0.5...v0.0.6) (2021-04-25)
|
|
6
28
|
|
|
7
29
|
### Features
|
package/README.md
CHANGED
|
@@ -31,6 +31,17 @@ Shared ECMAScript Config (TS, Lint, Prettier)
|
|
|
31
31
|
}
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
+
If you're using React:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"extends": [
|
|
39
|
+
"./node_modules/@nihalgonsalves/esconfig/.eslintrc",
|
|
40
|
+
"./node_modules/@nihalgonsalves/esconfig/.eslintrc.react"
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
34
45
|
4. `.prettierrc`
|
|
35
46
|
|
|
36
47
|
```json
|
|
@@ -43,7 +54,7 @@ Shared ECMAScript Config (TS, Lint, Prettier)
|
|
|
43
54
|
{
|
|
44
55
|
"scripts": {
|
|
45
56
|
"build": "tsc",
|
|
46
|
-
"lint": "eslint
|
|
57
|
+
"lint": "eslint ./src/",
|
|
47
58
|
"format": "prettier . --write",
|
|
48
59
|
"format:check": "prettier . --check"
|
|
49
60
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
/** @type import('eslint-define-config').EslintConfig['rules'] */
|
|
4
|
+
module.exports = {
|
|
5
|
+
'import/prefer-default-export': 'off',
|
|
6
|
+
'import/no-default-export': 'error',
|
|
7
|
+
'import/order': [
|
|
8
|
+
'error',
|
|
9
|
+
{
|
|
10
|
+
pathGroups: [
|
|
11
|
+
{
|
|
12
|
+
pattern: '@nihalgonsalves/**',
|
|
13
|
+
group: 'internal',
|
|
14
|
+
position: 'after',
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
pathGroupsExcludedImportTypes: ['builtin'],
|
|
18
|
+
groups: [
|
|
19
|
+
'builtin',
|
|
20
|
+
'external',
|
|
21
|
+
'internal',
|
|
22
|
+
'unknown',
|
|
23
|
+
'parent',
|
|
24
|
+
'sibling',
|
|
25
|
+
'index',
|
|
26
|
+
],
|
|
27
|
+
'newlines-between': 'always',
|
|
28
|
+
alphabetize: { order: 'asc' },
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
'no-unsafe-optional-chaining': 'error',
|
|
32
|
+
'no-void': ['error', { allowAsStatement: true }],
|
|
33
|
+
'@typescript-eslint/no-unused-vars': [
|
|
34
|
+
'error',
|
|
35
|
+
{ ignoreRestSiblings: true, argsIgnorePattern: '^_' },
|
|
36
|
+
],
|
|
37
|
+
'@typescript-eslint/consistent-type-imports': 'error',
|
|
38
|
+
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
|
|
39
|
+
'@typescript-eslint/prefer-optional-chain': 'error',
|
|
40
|
+
'@typescript-eslint/prefer-nullish-coalescing': 'error',
|
|
41
|
+
'@typescript-eslint/ban-ts-comment': [
|
|
42
|
+
'error',
|
|
43
|
+
{
|
|
44
|
+
'ts-expect-error': 'allow-with-description',
|
|
45
|
+
'ts-ignore': true,
|
|
46
|
+
'ts-nocheck': true,
|
|
47
|
+
'ts-check': false,
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
'func-style': ['error', 'expression'],
|
|
51
|
+
'@typescript-eslint/consistent-type-assertions': [
|
|
52
|
+
'error',
|
|
53
|
+
{
|
|
54
|
+
assertionStyle: 'never',
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
// TODO: https://github.com/typescript-eslint/typescript-eslint/issues/3104
|
|
58
|
+
'@typescript-eslint/dot-notation': 'off',
|
|
59
|
+
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nihalgonsalves/esconfig",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Shared ECMAScript Config (TS, Lint, Prettier)",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": "git@github.com:nihalgonsalves/esconfig.git",
|
|
7
7
|
"author": "Nihal Gonsalves <nihal@nihalgonsalves.com>",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"files": [
|
|
10
|
-
".
|
|
10
|
+
"eslint-rules-base.js",
|
|
11
|
+
".eslintrc.js",
|
|
12
|
+
".eslintrc.react.js",
|
|
11
13
|
".prettierrc.js",
|
|
12
14
|
"tsconfig.json"
|
|
13
15
|
],
|
|
@@ -24,28 +26,28 @@
|
|
|
24
26
|
"prepare": "husky install"
|
|
25
27
|
},
|
|
26
28
|
"dependencies": {
|
|
27
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
28
|
-
"@typescript-eslint/parser": "^
|
|
29
|
-
"eslint-config-airbnb-typescript": "^
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "^5.8.1",
|
|
30
|
+
"@typescript-eslint/parser": "^5.8.1",
|
|
31
|
+
"eslint-config-airbnb-typescript": "^16.1.0",
|
|
30
32
|
"eslint-config-prettier": "^8.3.0",
|
|
31
|
-
"eslint-plugin-import": "^2.
|
|
32
|
-
"eslint-plugin-jsx-a11y": "^6.
|
|
33
|
-
"eslint-plugin-react": "^7.
|
|
34
|
-
"eslint-plugin-react-hooks": "^4.
|
|
33
|
+
"eslint-plugin-import": "^2.25.3",
|
|
34
|
+
"eslint-plugin-jsx-a11y": "^6.5.1",
|
|
35
|
+
"eslint-plugin-react": "^7.28.0",
|
|
36
|
+
"eslint-plugin-react-hooks": "^4.3.0"
|
|
35
37
|
},
|
|
36
38
|
"devDependencies": {
|
|
37
|
-
"@commitlint/cli": "^
|
|
38
|
-
"@commitlint/config-conventional": "^
|
|
39
|
-
"eslint": "^
|
|
40
|
-
"eslint-define-config": "^1.
|
|
41
|
-
"husky": "^
|
|
42
|
-
"prettier": "^2.
|
|
43
|
-
"standard-version": "^9.2
|
|
44
|
-
"typescript": "^4.
|
|
39
|
+
"@commitlint/cli": "^16.0.1",
|
|
40
|
+
"@commitlint/config-conventional": "^16.0.0",
|
|
41
|
+
"eslint": "^8.5.0",
|
|
42
|
+
"eslint-define-config": "^1.2.1",
|
|
43
|
+
"husky": "^7.0.4",
|
|
44
|
+
"prettier": "^2.5.1",
|
|
45
|
+
"standard-version": "^9.3.2",
|
|
46
|
+
"typescript": "^4.5.4"
|
|
45
47
|
},
|
|
46
48
|
"peerDependencies": {
|
|
47
|
-
"eslint": "^
|
|
48
|
-
"prettier": "^2.
|
|
49
|
-
"typescript": "^4.
|
|
49
|
+
"eslint": "^8.5.0",
|
|
50
|
+
"prettier": "^2.5.1",
|
|
51
|
+
"typescript": "^4.5.4"
|
|
50
52
|
}
|
|
51
53
|
}
|