eslint-config-gorgon 3.1.0 → 3.2.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/README.md +12 -31
- package/dist/index.js +1 -1
- package/package.json +19 -6
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
> [!
|
|
2
|
-
>
|
|
1
|
+
> [!NOTE]
|
|
2
|
+
> Stable and ready for use.
|
|
3
3
|
|
|
4
4
|
### Why
|
|
5
5
|
|
|
@@ -7,45 +7,26 @@ This package includes prettier and eslint in one extends.
|
|
|
7
7
|
|
|
8
8
|
You can easily use it in your project.
|
|
9
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
|
-
```
|
|
22
|
-
|
|
23
|
-
|
|
24
10
|
### Install
|
|
25
11
|
|
|
26
12
|
```zsh
|
|
27
13
|
pnpm i -D eslint-config-gorgon
|
|
28
14
|
```
|
|
29
15
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
In your eslint config file:
|
|
16
|
+
### Minimal Usage
|
|
33
17
|
|
|
34
18
|
`.eslint.config.mjs`
|
|
35
19
|
|
|
36
20
|
```js
|
|
37
|
-
import gorgon from 'eslint-config-gorgon'
|
|
38
|
-
export default gorgon
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
export default
|
|
46
|
-
...gorgonLints,
|
|
47
|
-
// other lints
|
|
48
|
-
]
|
|
21
|
+
import gorgon from 'eslint-config-gorgon'
|
|
22
|
+
export default gorgon
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### With Options
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
import { init } from 'eslint-config-gorgon'
|
|
29
|
+
export default init({ a11y: true, react: true, tailwind: true, prettier: true, typescript: true })
|
|
49
30
|
```
|
|
50
31
|
|
|
51
32
|
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import S from"eslint-plugin-perfectionist";var T=[S.configs["recommended-natural"],{rules:{curly:["error","multi-line"],"no-console":"warn","no-unused-vars":"warn","perfectionist/sort-enums":"warn"}}],c=T;import k from"eslint-plugin-jsx-a11y";var I=[k.flatConfigs.recommended],a=I;import P from"eslint-config-prettier";var R=[P],p=R;import u from"eslint-plugin-react";import v from"eslint-plugin-react-hooks";var F=[u.configs.flat.recommended,v.configs["recommended-latest"],{...u.configs.flat["jsx-runtime"],files:["**/*.ts","**/*.tsx","**/*.jsx","**/*.js"],settings:{react:{version:"detect"}}}],f=F;import H from"eslint-plugin-sonarjs";var l=[H.configs.recommended];import _ from"eslint-plugin-tailwindcss";var E=[{name:"tailwindcss/recommended",plugins:{tailwindcss:_},rules:{"tailwindcss/classnames-order":"warn","tailwindcss/no-custom-classname":"off"},files:["**/*.{js,jsx,ts,tsx,vue,html}"]}],d=E;import L from"typescript-eslint";var J=[...L.configs.recommended,{rules:{"@typescript-eslint/array-type":["error",{default:"array-simple"}],"@typescript-eslint/ban-ts-comment":["error",{"ts-check":!1,"ts-expect-error":"allow-with-description","ts-ignore":!1,"ts-nocheck":!1}],"@typescript-eslint/consistent-type-definitions":["error","interface"],"@typescript-eslint/consistent-type-imports":["warn",{fixStyle:"separate-type-imports",prefer:"type-imports"}],"@typescript-eslint/no-confusing-non-null-assertion":"error","@typescript-eslint/no-duplicate-imports":"error","@typescript-eslint/no-explicit-any":"warn","@typescript-eslint/no-non-null-assertion":"warn","@typescript-eslint/no-unused-vars":["error",{argsIgnorePattern:"^_",caughtErrorsIgnorePattern:"^_",varsIgnorePattern:"^_"}],"@typescript-eslint/prefer-as-const":"error"}}],r=J;import g from"fs";import D from"path";import A from"fast-glob";var N=()=>{let t=D.join(process.cwd(),"package.json");if(g.existsSync(t)){let o=JSON.parse(g.readFileSync(t,"utf-8")),e=o.dependencies||{},s=o.devDependencies||{};if("react"in e||"react"in s)return!0}try{return A.sync(["src/**/*.jsx","src/**/*.tsx"],{cwd:process.cwd(),ignore:["**/node_modules/**","dist/**","output/**"],dot:!1}).length>0}catch{return!1}},y=N;import m from"fs";import x from"path";var O=()=>["tailwind.config.js","tailwind.config.cjs","tailwind.config.mjs","tailwind.config.ts","tailwind.config.mts"].some(s=>m.existsSync(x.join(process.cwd(),s)))?!0:["postcss.config.js","postcss.config.cjs","postcss.config.mjs","postcss.config.ts","postcss.config.mts"].some(s=>{let i=x.join(process.cwd(),s);return m.existsSync(i)&&/tailwindcss/.test(m.readFileSync(i,"utf-8"))}),w=O;import U from"fs";import q from"path";import z from"fast-glob";var B=q.join(process.cwd(),"tsconfig.json"),G=()=>{if(U.existsSync(B))return!0;try{return z.sync(["src/**/*.ts","src/**/*.tsx"],{cwd:process.cwd(),ignore:["**/node_modules/**","dist/**","output/**"],dot:!1}).length>0}catch{return!1}},h=G;var j=y(),C=w(),b=h();var K=[...c,...l],n=(t,o)=>t===void 0?o:t,M=t=>{let e=[{ignores:[...["**/node_modules/**","dist/**","output/**"],...t?.ignores??[]]},...K];return n(t?.react,j)&&e.push(...f),n(t?.a11y,!0)&&e.push(...a),n(t?.tailwind,C)&&e.push(...d),n(t?.prettier,!0)&&e.push(...p),n(t?.typescript,b)&&(e=e.map(s=>({...s,files:["**/*.ts","**/*.tsx",...s?.files?.flat(1/0)??[]]})),e.some(s=>r.includes(s))||e.push(...r.map(s=>({...s,files:["**/*.ts","**/*.tsx",...s?.files?.flat(1/0)??[]]}))),e.push({rules:{"no-unused-vars":"off"}})),e},Et=M();export{Et as default,M as init};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-gorgon",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,14 +12,14 @@
|
|
|
12
12
|
"dist/*"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
+
"eslint-plugin-sonarjs": "^3.0.5",
|
|
15
16
|
"eslint-config-prettier": "^10.1.8",
|
|
16
17
|
"eslint-plugin-import": "^2.32.0",
|
|
17
18
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
18
19
|
"eslint-plugin-perfectionist": "^4.15.0",
|
|
19
|
-
"eslint-plugin-prettier": "^5.5.4",
|
|
20
20
|
"eslint-plugin-react": "^7.37.5",
|
|
21
21
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
22
|
-
"eslint-plugin-tailwindcss": "
|
|
22
|
+
"eslint-plugin-tailwindcss": "^3.14.2",
|
|
23
23
|
"fast-glob": "^3.3.3",
|
|
24
24
|
"ignore": "^7.0.5",
|
|
25
25
|
"prettier": "^3.6.2",
|
|
@@ -32,16 +32,29 @@
|
|
|
32
32
|
"@types/node": "^24.2.0",
|
|
33
33
|
"@typescript-eslint/utils": "^8.39.0",
|
|
34
34
|
"eslint": "^9.32.0",
|
|
35
|
+
"vitest": "^2.0.5",
|
|
35
36
|
"tsup": "^8.5.0",
|
|
36
37
|
"typescript": "^5.9.2"
|
|
37
38
|
},
|
|
38
39
|
"engines": {
|
|
39
|
-
"node": ">=
|
|
40
|
+
"node": ">=18.18 || >=20"
|
|
40
41
|
},
|
|
42
|
+
"exports": {
|
|
43
|
+
".": {
|
|
44
|
+
"types": "./dist/index.d.ts",
|
|
45
|
+
"import": "./dist/index.js"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"types": "./dist/index.d.ts",
|
|
49
|
+
"sideEffects": false,
|
|
41
50
|
"scripts": {
|
|
42
|
-
"lint": "npx eslint",
|
|
51
|
+
"lint": "npx eslint .",
|
|
52
|
+
"lint:fix": "npx eslint . --fix",
|
|
53
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
43
54
|
"build": "tsup",
|
|
44
55
|
"build:watch": "tsup --watch",
|
|
45
|
-
"dev": "npm run build && npm run lint"
|
|
56
|
+
"dev": "npm run build && npm run lint",
|
|
57
|
+
"test": "vitest run",
|
|
58
|
+
"test:watch": "vitest"
|
|
46
59
|
}
|
|
47
60
|
}
|