@shufflies/eslint-config 1.0.0 → 1.0.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 CHANGED
@@ -8,7 +8,7 @@ It's my own personal set of reusable eslint configuration.
8
8
  Install the package:
9
9
 
10
10
  ```shell
11
- pnpm i -D @shufflies/eslint-config
11
+ npm install -D @shufflies/eslint-config
12
12
  ```
13
13
 
14
14
  Reference it in an `eslint.config.mjs` or `eslint.config.ts`:
@@ -23,6 +23,13 @@ import { defineConfig } from "eslint/config";
23
23
  export default defineConfig(
24
24
  ...recommended({
25
25
  gitignorePaths: [fileURLToPath(new URL(".gitignore", import.meta.url))],
26
- })
26
+ }),
27
+
28
+ // Other rule/config overrides
29
+ {
30
+ rules: {
31
+ "some/rule": "off"
32
+ }
33
+ }
27
34
  );
28
35
  ```
@@ -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
+ }
@@ -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
+ }
@@ -0,0 +1 @@
1
+ export { recommended } from "./configs.js";
@@ -0,0 +1,5 @@
1
+ import { type FlatConfig } from "@eslint/compat";
2
+ export interface RecommendedConfigArgs {
3
+ gitignorePaths?: string[];
4
+ }
5
+ export declare function recommended(args?: RecommendedConfigArgs): ReadonlyArray<FlatConfig>;
@@ -0,0 +1,2 @@
1
+ export { recommended } from "./configs.js";
2
+ export type { RecommendedConfigArgs } from "./configs.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shufflies/eslint-config",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "exports": {
@@ -14,11 +14,12 @@
14
14
  "lib"
15
15
  ],
16
16
  "scripts": {
17
- "prepare": "husky install",
17
+ "prepare": "husky",
18
18
  "clean": "rimraf lib",
19
- "build:types": "tsc --declaration --emitDeclarationOnly --outDir lib/types -p .",
20
- "build:cjs": "tsc --module commonjs --outDir lib/cjs -p .",
21
- "build:esm": "tsc --module nodenext --outDir lib/esm -p .",
19
+ "test": "eslint test --config test/eslint.config.mjs --report-unused-disable-directives",
20
+ "build:types": "tsc --declaration --emitDeclarationOnly --outDir lib/types -p src",
21
+ "build:cjs": "tsc --module commonjs --outDir lib/cjs -p src",
22
+ "build:esm": "tsc --module nodenext --outDir lib/esm -p src",
22
23
  "build": "zx scripts/build.mjs"
23
24
  },
24
25
  "keywords": [
@@ -27,7 +28,7 @@
27
28
  ],
28
29
  "author": "Royston Shufflebotham",
29
30
  "license": "MIT",
30
- "packageManager": "pnpm@10.11.0",
31
+ "packageManager": "npm@11.4.2",
31
32
  "publishConfig": {
32
33
  "access": "public",
33
34
  "registry": "https://registry.npmjs.org/"
@@ -43,7 +44,6 @@
43
44
  "@commitlint/cli": "^19.8.1",
44
45
  "@commitlint/config-conventional": "^19.8.1",
45
46
  "@semantic-release/changelog": "^6.0.3",
46
- "@semantic-release/git": "^10.0.1",
47
47
  "@semantic-release/github": "^11.0.3",
48
48
  "@semantic-release/npm": "^12.0.1",
49
49
  "@types/node": "^24.0.1",