@kembec/eslint-config 1.1.2 → 1.1.3
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/Readme.md +27 -9
- package/index.js +1 -3
- package/package.json +4 -2
- package/.github/workflows/npm-publish.yaml +0 -22
package/Readme.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Streamlined ESLint Configuration for JS/TS Projects
|
|
2
2
|
|
|
3
|
-
This document outlines
|
|
3
|
+
This document outlines how to integrate my ESLint setup into your JavaScript or TypeScript projects. It's a personal collection of configurations and plugins designed to enforce a consistent coding style and catch common errors.
|
|
4
4
|
|
|
5
5
|
## Quick Start Guide
|
|
6
6
|
|
|
@@ -16,23 +16,19 @@ npm install -D @kembec/eslint-config
|
|
|
16
16
|
|
|
17
17
|
Modify your ESLint configuration file to use this package. The setup varies slightly depending on whether you're working with plain JavaScript or TypeScript.
|
|
18
18
|
|
|
19
|
-
- **For JavaScript Projects**: In your `.eslintrc` (which could be
|
|
19
|
+
- **For JavaScript Projects**: In your `.eslintrc` file (which could be `.json`, `.js`, or `.ts`), include the following setup. To use Jest, change the extends value as shown in the comment:
|
|
20
20
|
|
|
21
21
|
```json
|
|
22
22
|
{
|
|
23
|
-
"extends": ["@kembec/eslint-config"]
|
|
24
|
-
// Include Jest
|
|
25
|
-
"extends": ["@kembec/eslint-config/jest"]
|
|
23
|
+
"extends": ["@kembec/eslint-config"] // To use Jest, change to "@kembec/eslint-config/jest"
|
|
26
24
|
}
|
|
27
25
|
```
|
|
28
26
|
|
|
29
|
-
- **For TypeScript Projects**: To
|
|
27
|
+
- **For TypeScript Projects**: To include TypeScript-specific rules and configure parser options, use the following setup. To use Jest, modify the extends value as shown in the comment:
|
|
30
28
|
|
|
31
29
|
```json
|
|
32
30
|
{
|
|
33
|
-
"extends": ["@kembec/eslint-config/typescript"],
|
|
34
|
-
// Include Jest
|
|
35
|
-
"extends": ["@kembec/eslint-config/typescript/jest"]
|
|
31
|
+
"extends": ["@kembec/eslint-config/typescript"], // To use Jest, change to "@kembec/eslint-config/typescript/jest"
|
|
36
32
|
"overrides": [
|
|
37
33
|
{
|
|
38
34
|
"files": ["*.ts", "*.tsx"],
|
|
@@ -44,8 +40,30 @@ Modify your ESLint configuration file to use this package. The setup varies slig
|
|
|
44
40
|
}
|
|
45
41
|
```
|
|
46
42
|
|
|
43
|
+
- **For React Projects**:
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"extends": [
|
|
48
|
+
"@kembec/eslint-config/typescript",
|
|
49
|
+
"plugin:@typescript-eslint/recommended",
|
|
50
|
+
"plugin:react-hooks/recommended"
|
|
51
|
+
],
|
|
52
|
+
"ignorePatterns": ["dist", ".eslintrc.cjs", "vite.config.ts"],
|
|
53
|
+
"overrides": [
|
|
54
|
+
{
|
|
55
|
+
"files": ["src/**/*.ts", "src/**/*.tsx"],
|
|
56
|
+
"parserOptions": {
|
|
57
|
+
"project": ["./tsconfig.json"]
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
47
64
|
## Included Plugins
|
|
48
65
|
|
|
66
|
+
|
|
49
67
|
The configuration incorporates a carefully selected set of ESLint plugins to assist with various code quality and style concerns:
|
|
50
68
|
|
|
51
69
|
- `eslint-plugin-import`: Manages and validates import statements.
|
package/index.js
CHANGED
|
@@ -11,8 +11,6 @@ module.exports = {
|
|
|
11
11
|
extends: [
|
|
12
12
|
"eslint:recommended",
|
|
13
13
|
"plugin:prettier/recommended",
|
|
14
|
-
...["./rules/best-practices", "./rules/errors", "./rules/style", "./rules/plugins"].map(
|
|
15
|
-
require.resolve,
|
|
16
|
-
),
|
|
14
|
+
...["./rules/best-practices", "./rules/errors", "./rules/style", "./rules/plugins"].map(require.resolve),
|
|
17
15
|
],
|
|
18
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kembec/eslint-config",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "My personal linter configuration for JavaScript/TypeScript",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -18,10 +18,12 @@
|
|
|
18
18
|
"lint",
|
|
19
19
|
"prettier",
|
|
20
20
|
"jest",
|
|
21
|
+
"react",
|
|
22
|
+
"react-ts",
|
|
21
23
|
"kembec"
|
|
22
24
|
],
|
|
23
25
|
"author": "Kembec.com",
|
|
24
|
-
"license": "AGPL-3.0
|
|
26
|
+
"license": "AGPL-3.0",
|
|
25
27
|
"bugs": {
|
|
26
28
|
"url": "https://github.com/Kembec/eslint-config-kembec/issues"
|
|
27
29
|
},
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
name: 'Publish in NPM'
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
npm-publish:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
environment: NPM
|
|
12
|
-
steps:
|
|
13
|
-
- uses: actions/checkout@v3
|
|
14
|
-
- uses: actions/setup-node@v3
|
|
15
|
-
with:
|
|
16
|
-
node-version: '16'
|
|
17
|
-
registry-url: 'https://registry.npmjs.org/'
|
|
18
|
-
- run: npm install
|
|
19
|
-
- run: npm run build --if-present
|
|
20
|
-
- uses: JS-DevTools/npm-publish@v1
|
|
21
|
-
with:
|
|
22
|
-
token: ${{ secrets.TOKEN_NPM }}
|