eslint-config-gorgon 2.0.7 → 2.0.9
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 +26 -17
- package/dist/index.js +1 -1
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -3,9 +3,23 @@
|
|
|
3
3
|
|
|
4
4
|
### Why
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
This package includes prettier and eslint in one extends.
|
|
7
|
+
|
|
8
|
+
You can easily use it in your project.
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Usage
|
|
12
|
+
|
|
13
|
+
You can use it quickly via CLI:
|
|
14
|
+
|
|
15
|
+
```zsh
|
|
16
|
+
# Using npx
|
|
17
|
+
npx gorgon-lint-cli
|
|
18
|
+
|
|
19
|
+
# Using pnpm
|
|
20
|
+
pnpm dlx gorgon-lint-cli
|
|
21
|
+
```
|
|
7
22
|
|
|
8
|
-
you can eazy use it.
|
|
9
23
|
|
|
10
24
|
### Install
|
|
11
25
|
|
|
@@ -13,9 +27,9 @@ you can eazy use it.
|
|
|
13
27
|
pnpm i -D eslint-config-gorgon
|
|
14
28
|
```
|
|
15
29
|
|
|
16
|
-
|
|
30
|
+
#### Configuration Method
|
|
17
31
|
|
|
18
|
-
|
|
32
|
+
In your eslint config file:
|
|
19
33
|
|
|
20
34
|
`.eslint.config.mjs`
|
|
21
35
|
|
|
@@ -25,8 +39,16 @@ export default gorgon;
|
|
|
25
39
|
// or
|
|
26
40
|
import { init } from 'eslint-config-gorgon';
|
|
27
41
|
export default init();
|
|
42
|
+
// or
|
|
43
|
+
import { init } from 'eslint-config-gorgon';
|
|
44
|
+
const gorgonLints = init();
|
|
45
|
+
export default [
|
|
46
|
+
...gorgonLints,
|
|
47
|
+
// other lints
|
|
48
|
+
]
|
|
28
49
|
```
|
|
29
50
|
|
|
51
|
+
|
|
30
52
|
### VsCode Setting (Optional)
|
|
31
53
|
`./vscode/settings.json`
|
|
32
54
|
|
|
@@ -48,16 +70,3 @@ export default init();
|
|
|
48
70
|
"recommendations": ["dbaeumer.vscode-eslint"]
|
|
49
71
|
}
|
|
50
72
|
```
|
|
51
|
-
|
|
52
|
-
### How it work
|
|
53
|
-
|
|
54
|
-
[using-a-shareable-configuration-package](https://eslint.org/docs/latest/use/configure/configuration-files#using-a-shareable-configuration-package)
|
|
55
|
-
|
|
56
|
-
<!-- ### Desc
|
|
57
|
-
|
|
58
|
-
> just collect recommended eslint, no more custom rules.
|
|
59
|
-
|
|
60
|
-
- eslint
|
|
61
|
-
- typescript
|
|
62
|
-
- react
|
|
63
|
-
- prettier -->
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import C from"eslint-plugin-perfectionist";var r=[C.configs["recommended-natural"],{rules:{"no-console":"warn","no-unused-vars":"warn","perfectionist/sort-enums":"warn"}}];import S from"eslint-plugin-jsx-a11y";var a=[S.flatConfigs.recommended];import T from"eslint-config-prettier";import j from"eslint-plugin-prettier/recommended";var p=[j,T];import m from"eslint-plugin-react";import b from"eslint-plugin-react-hooks";var k=[m.configs.flat.recommended,b.configs["recommended-latest"],{...m.configs.flat["jsx-runtime"],files:["**/*.ts","**/*.tsx","**/*.jsx","**/*.js"],settings:{react:{version:"detect"}}}],c=k;import P from"eslint-plugin-tailwindcss";var f=[...P.configs["flat/recommended"]];import R from"typescript-eslint";var l=[...R.configs.recommended,{rules:{"@typescript-eslint/no-explicit-any":"warn"}}];import d from"fs";import L from"path";var F=()=>{let t=L.join(process.cwd(),"package.json");if(d.existsSync(t)){let e=JSON.parse(d.readFileSync(t,"utf-8")),i=e.dependencies||{},n=e.devDependencies||{};return"react"in i||"react"in n}return!1},u=F;import H from"fs";import I from"path";var E=()=>["tailwind.config.js","tailwind.config.cjs","tailwind.config.mjs","tailwind.config.ts","tailwind.config.mts"].some(i=>H.existsSync(I.join(process.cwd(),i))),g=E;import v from"fs";import J from"path";var A=J.join(process.cwd(),"tsconfig.json"),D=()=>v.existsSync(A),y=D;var s=u(),x=g(),h=y();var w=[...r],o=(t,e)=>t===void 0?e:t,N=t=>{let e=w;if(o(t?.react,s)&&e.push(...c),o(t?.a11y,s)&&e.push(...a),o(t?.tailwind,x)&&e.push(...f),o(t?.prettier,s)&&e.push(...p),o(t?.typescript,h)){let i=["**/node_modules/**","dist/**","output/**"];e=[...w,...l].map(n=>({...n,files:["**/*.ts","**/*.tsx",...n?.files?.flat(1/0)??[]],ignores:[...i,...t?.ignores??[]]}))}return e},St=N();export{St as default,N as init};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-gorgon",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,12 +27,16 @@
|
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@eslint/js": "^9.9.1",
|
|
30
|
+
"@jest/types": "^29.6.3",
|
|
30
31
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
31
32
|
"@types/eslint-plugin-jsx-a11y": "^6.9.0",
|
|
32
33
|
"@types/eslint-plugin-tailwindcss": "^3.17.0",
|
|
33
34
|
"@types/eslint__js": "^8.42.3",
|
|
35
|
+
"@types/jest": "^29.4.1",
|
|
34
36
|
"@types/node": "^22.5.2",
|
|
35
37
|
"eslint": "^9.9.1",
|
|
38
|
+
"jest": "^29.5.0",
|
|
39
|
+
"ts-jest": "^29.0.5",
|
|
36
40
|
"tsup": "^8.2.4",
|
|
37
41
|
"typescript": "^5.5.4"
|
|
38
42
|
},
|
|
@@ -40,6 +44,7 @@
|
|
|
40
44
|
"lint": "npx eslint",
|
|
41
45
|
"build": "tsup",
|
|
42
46
|
"build:watch": "tsup --watch",
|
|
43
|
-
"dev": "npm run build && npm run lint"
|
|
47
|
+
"dev": "npm run build && npm run lint",
|
|
48
|
+
"test": "jest"
|
|
44
49
|
}
|
|
45
50
|
}
|