@ntnyq/eslint-config 3.1.0 → 3.1.2
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 +6 -4
- package/dist/index.cjs +24 -6
- package/dist/index.d.cts +67 -50
- package/dist/index.d.ts +67 -50
- package/dist/index.js +24 -6
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
- Opinionable: single quotes, no semi
|
|
13
13
|
- Designed to work alongside with [Prettier](https://prettier.io)
|
|
14
|
+
- Respect `.gitignore` via [eslint-config-flat-gitignore](https://github.com/antfu/eslint-config-flat-gitignore)
|
|
14
15
|
- Out-of-box support for TypeScript, Vue, JSON, Markdown, YAML, etc.
|
|
15
16
|
- [ESLint flat config](https://eslint.org/docs/latest/use/configure/configuration-files) for ESLint v9.5.0+
|
|
16
17
|
|
|
@@ -30,14 +31,15 @@ import { defineESLintConfig } from '@ntnyq/eslint-config'
|
|
|
30
31
|
export default defineESLintConfig()
|
|
31
32
|
```
|
|
32
33
|
|
|
33
|
-
Add scripts `lint` in `package.json
|
|
34
|
+
Add scripts `lint` in `package.json` and config prettier:
|
|
34
35
|
|
|
35
36
|
```json
|
|
36
37
|
{
|
|
37
38
|
"scripts": {
|
|
38
39
|
"lint": "eslint .",
|
|
39
40
|
"lint:fix": "eslint . --fix"
|
|
40
|
-
}
|
|
41
|
+
},
|
|
42
|
+
"prettier": "@ntnyq/prettier-config"
|
|
41
43
|
}
|
|
42
44
|
```
|
|
43
45
|
|
|
@@ -85,12 +87,12 @@ pnpm add husky nano-staged -D
|
|
|
85
87
|
"prepare": "husky"
|
|
86
88
|
},
|
|
87
89
|
"nano-staged": {
|
|
88
|
-
"*.{js,ts,cjs,mjs,vue,md,yml,yaml,json,html}": "eslint --fix"
|
|
90
|
+
"*.{js,ts,cjs,mjs,jsx,tsx,vue,md,yml,yaml,json,html}": "eslint --fix"
|
|
89
91
|
}
|
|
90
92
|
}
|
|
91
93
|
```
|
|
92
94
|
|
|
93
|
-
### 3. Add a hook
|
|
95
|
+
### 3. Add a git hook
|
|
94
96
|
|
|
95
97
|
```bash
|
|
96
98
|
echo "nano-staged" > .husky/pre-commit
|
package/dist/index.cjs
CHANGED
|
@@ -935,6 +935,21 @@ var sort = (options = {}) => {
|
|
|
935
935
|
}
|
|
936
936
|
);
|
|
937
937
|
}
|
|
938
|
+
if (options.pnpmWorkspace ?? true) {
|
|
939
|
+
configs.push({
|
|
940
|
+
name: "ntnyq/sort/pnpm-workspace",
|
|
941
|
+
files: ["**/pnpm-workspace.yaml"],
|
|
942
|
+
rules: {
|
|
943
|
+
"yml/sort-keys": [
|
|
944
|
+
"error",
|
|
945
|
+
{
|
|
946
|
+
pathPattern: ".*",
|
|
947
|
+
order: { type: "asc" }
|
|
948
|
+
}
|
|
949
|
+
]
|
|
950
|
+
}
|
|
951
|
+
});
|
|
952
|
+
}
|
|
938
953
|
return configs;
|
|
939
954
|
};
|
|
940
955
|
|
|
@@ -1458,12 +1473,15 @@ var prettier = (options = {}) => {
|
|
|
1458
1473
|
|
|
1459
1474
|
// src/configs/gitignore.ts
|
|
1460
1475
|
var import_eslint_config_flat_gitignore = __toESM(require("eslint-config-flat-gitignore"), 1);
|
|
1461
|
-
var gitignore = (options = {}) =>
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1476
|
+
var gitignore = (options = {}) => {
|
|
1477
|
+
options.strict ??= false;
|
|
1478
|
+
return [
|
|
1479
|
+
{
|
|
1480
|
+
...(0, import_eslint_config_flat_gitignore.default)(options),
|
|
1481
|
+
name: "ntnyq/gitignore"
|
|
1482
|
+
}
|
|
1483
|
+
];
|
|
1484
|
+
};
|
|
1467
1485
|
|
|
1468
1486
|
// src/configs/javascript.ts
|
|
1469
1487
|
var import_js = __toESM(require("@eslint/js"), 1);
|