@shufflies/eslint-config 1.0.0 → 1.0.1
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/CHANGELOG.md +13 -0
- package/lib/cjs/configs.js +69 -0
- package/lib/cjs/index.js +5 -0
- package/lib/esm/configs.js +63 -0
- package/lib/esm/index.js +1 -0
- package/lib/types/configs.d.ts +5 -0
- package/lib/types/index.d.ts +2 -0
- package/package.json +2 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
## [1.0.1](https://github.com/RoystonS/shufflies-eslint-config/compare/v1.0.0...v1.0.1) (2025-06-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* build package before publishing ([f2bb21c](https://github.com/RoystonS/shufflies-eslint-config/commit/f2bb21c0803c7066066536521e57d206b5b6e52d))
|
|
7
|
+
|
|
8
|
+
# 1.0.0 (2025-06-14)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* perform release ([0b81384](https://github.com/RoystonS/shufflies-eslint-config/commit/0b81384545bca1f6844a620181714b39079c5ec1))
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.recommended = recommended;
|
|
7
|
+
const compat_1 = require("@eslint/compat");
|
|
8
|
+
const js_1 = __importDefault(require("@eslint/js"));
|
|
9
|
+
const eslint_plugin_simple_import_sort_1 = __importDefault(require("eslint-plugin-simple-import-sort"));
|
|
10
|
+
const eslint_plugin_unicorn_1 = __importDefault(require("eslint-plugin-unicorn"));
|
|
11
|
+
const typescript_eslint_1 = __importDefault(require("typescript-eslint"));
|
|
12
|
+
function recommended(args = {}) {
|
|
13
|
+
const { gitignorePaths = [] } = args;
|
|
14
|
+
const gitIgnores = gitignorePaths.map((gitIgnorePath) => {
|
|
15
|
+
const ignoreConfig = (0, compat_1.includeIgnoreFile)(gitIgnorePath);
|
|
16
|
+
return ignoreConfig.ignores;
|
|
17
|
+
});
|
|
18
|
+
const result = [
|
|
19
|
+
{
|
|
20
|
+
ignores: gitIgnores.flat(),
|
|
21
|
+
},
|
|
22
|
+
js_1.default.configs.recommended,
|
|
23
|
+
typescript_eslint_1.default.configs.recommended,
|
|
24
|
+
eslint_plugin_unicorn_1.default.configs.recommended,
|
|
25
|
+
{
|
|
26
|
+
rules: {
|
|
27
|
+
"unicorn/filename-case": "off",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
plugins: {
|
|
32
|
+
"simple-import-sort": eslint_plugin_simple_import_sort_1.default,
|
|
33
|
+
},
|
|
34
|
+
rules: {
|
|
35
|
+
// ✅ Prefer and autofix to `import type`
|
|
36
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
37
|
+
"error",
|
|
38
|
+
{
|
|
39
|
+
prefer: "type-imports",
|
|
40
|
+
disallowTypeAnnotations: false,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
// ✅ Group + sort import lines, sort named specifiers
|
|
44
|
+
"simple-import-sort/imports": "error",
|
|
45
|
+
"simple-import-sort/exports": "error",
|
|
46
|
+
// ✅ Good hygiene
|
|
47
|
+
"no-duplicate-imports": "error",
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
rules: {
|
|
52
|
+
"@typescript-eslint/no-empty-object-type": "off",
|
|
53
|
+
"@typescript-eslint/no-unused-vars": [
|
|
54
|
+
"error",
|
|
55
|
+
{
|
|
56
|
+
args: "all",
|
|
57
|
+
argsIgnorePattern: "^_",
|
|
58
|
+
caughtErrors: "all",
|
|
59
|
+
caughtErrorsIgnorePattern: "^_",
|
|
60
|
+
destructuredArrayIgnorePattern: "^_",
|
|
61
|
+
varsIgnorePattern: "^_",
|
|
62
|
+
ignoreRestSiblings: true,
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
];
|
|
68
|
+
return result;
|
|
69
|
+
}
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.recommended = void 0;
|
|
4
|
+
var configs_js_1 = require("./configs.js");
|
|
5
|
+
Object.defineProperty(exports, "recommended", { enumerable: true, get: function () { return configs_js_1.recommended; } });
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { includeIgnoreFile } from "@eslint/compat";
|
|
2
|
+
import eslint from "@eslint/js";
|
|
3
|
+
import simpleImportSort from "eslint-plugin-simple-import-sort";
|
|
4
|
+
import eslintPluginUnicorn from "eslint-plugin-unicorn";
|
|
5
|
+
import tseslint from "typescript-eslint";
|
|
6
|
+
export function recommended(args = {}) {
|
|
7
|
+
const { gitignorePaths = [] } = args;
|
|
8
|
+
const gitIgnores = gitignorePaths.map((gitIgnorePath) => {
|
|
9
|
+
const ignoreConfig = includeIgnoreFile(gitIgnorePath);
|
|
10
|
+
return ignoreConfig.ignores;
|
|
11
|
+
});
|
|
12
|
+
const result = [
|
|
13
|
+
{
|
|
14
|
+
ignores: gitIgnores.flat(),
|
|
15
|
+
},
|
|
16
|
+
eslint.configs.recommended,
|
|
17
|
+
tseslint.configs.recommended,
|
|
18
|
+
eslintPluginUnicorn.configs.recommended,
|
|
19
|
+
{
|
|
20
|
+
rules: {
|
|
21
|
+
"unicorn/filename-case": "off",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
plugins: {
|
|
26
|
+
"simple-import-sort": simpleImportSort,
|
|
27
|
+
},
|
|
28
|
+
rules: {
|
|
29
|
+
// ✅ Prefer and autofix to `import type`
|
|
30
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
31
|
+
"error",
|
|
32
|
+
{
|
|
33
|
+
prefer: "type-imports",
|
|
34
|
+
disallowTypeAnnotations: false,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
// ✅ Group + sort import lines, sort named specifiers
|
|
38
|
+
"simple-import-sort/imports": "error",
|
|
39
|
+
"simple-import-sort/exports": "error",
|
|
40
|
+
// ✅ Good hygiene
|
|
41
|
+
"no-duplicate-imports": "error",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
rules: {
|
|
46
|
+
"@typescript-eslint/no-empty-object-type": "off",
|
|
47
|
+
"@typescript-eslint/no-unused-vars": [
|
|
48
|
+
"error",
|
|
49
|
+
{
|
|
50
|
+
args: "all",
|
|
51
|
+
argsIgnorePattern: "^_",
|
|
52
|
+
caughtErrors: "all",
|
|
53
|
+
caughtErrorsIgnorePattern: "^_",
|
|
54
|
+
destructuredArrayIgnorePattern: "^_",
|
|
55
|
+
varsIgnorePattern: "^_",
|
|
56
|
+
ignoreRestSiblings: true,
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
return result;
|
|
63
|
+
}
|
package/lib/esm/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { recommended } from "./configs.js";
|
package/package.json
CHANGED