@abyssalfragments/linter-config 1.1.1 → 1.2.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/dist/index.d.mts CHANGED
@@ -3,7 +3,10 @@ export declare enum SharedLicense {
3
3
  PRIVATE_MEDIA = "private-media",
4
4
  MIT = "mit"
5
5
  }
6
- type EslintConfig = {
6
+ type SharedConfig = {
7
+ extraIgnores?: string[];
8
+ };
9
+ type EslintConfig = SharedConfig & {
7
10
  license?: {
8
11
  text: string | string[];
9
12
  } | {
@@ -13,7 +16,7 @@ type EslintConfig = {
13
16
  };
14
17
  };
15
18
  declare function eslint(config?: EslintConfig): import("eslint/config").ConfigObject[];
16
- type OxfmtConfig = {
19
+ type OxfmtConfig = SharedConfig & {
17
20
  /** Uses tabs over spaces */
18
21
  rumiMode?: boolean;
19
22
  };
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import js from "@eslint/js";
2
+ import ts from "typescript-eslint";
2
3
  import unusedImports from "eslint-plugin-unused-imports";
3
4
  import globals from "globals";
4
- import tseslint from "typescript-eslint";
5
5
  import { defineConfig, globalIgnores } from "eslint/config";
6
6
  import header from "eslint-plugin-simple-header";
7
7
  import eslintConfigPrettier from "eslint-config-prettier/flat";
@@ -22,56 +22,62 @@ const Licenses = {
22
22
  ].join("\n\n"),
23
23
  ["mit"]: ["Copyright (c) 2026 Abyssal Fragments", "SPDX-License-Identifier: MIT"].join("\n")
24
24
  };
25
+ // src/shared.ts
26
+ const sharedIgnores = [
27
+ "dist",
28
+ "build",
29
+ "drizzle"
30
+ ];
25
31
  // src/eslint.ts
26
32
  const defaultConfig$1 = Object.freeze({});
27
33
  function eslint(config = defaultConfig$1) {
28
- return defineConfig([
29
- globalIgnores(["dist/*"]),
30
- tseslint.configs.recommended,
31
- {
32
- files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
33
- plugins: {
34
- js,
35
- "unused-imports": unusedImports,
36
- header
37
- },
38
- extends: [js.configs.recommended, eslintConfigPrettier],
39
- languageOptions: { globals: {
40
- ...globals.node,
41
- ...globals.nodeBuiltin
42
- } },
43
- rules: {
44
- ...config.license ? { "header/header": ["error", "file" in config.license ? { files: [config.license.file] } : { text: "shared" in config.license ? Licenses[config.license.shared] : config.license.text }] } : {},
45
- "no-undef": "off",
46
- "no-redeclare": "off",
47
- "@typescript-eslint/no-redeclare": "error",
48
- "unused-imports/no-unused-imports": "error",
49
- "no-unused-vars": "off",
50
- "@typescript-eslint/no-unused-vars": "off",
51
- "unused-imports/no-unused-vars": ["warn", {
52
- vars: "all",
53
- varsIgnorePattern: "^_",
54
- args: "after-used",
55
- argsIgnorePattern: "^_"
56
- }],
57
- "no-restricted-imports": ["error", { paths: [{
58
- name: "discord.js",
59
- importNames: ["Colors"],
60
- message: "Use StyledColors instead"
61
- }] }],
62
- "no-restricted-syntax": ["error", {
63
- selector: "Literal[raw=/^0x/i]",
64
- message: "Use StyledColors instead"
65
- }]
66
- }
34
+ return defineConfig([globalIgnores([...config.extraIgnores ? config.extraIgnores : [], ...sharedIgnores.map((i) => `${i}/*`)]), {
35
+ files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
36
+ plugins: {
37
+ js,
38
+ "unused-imports": unusedImports,
39
+ header
40
+ },
41
+ extends: [
42
+ js.configs.recommended,
43
+ eslintConfigPrettier,
44
+ ts.configs.recommended
45
+ ],
46
+ languageOptions: { globals: {
47
+ ...globals.node,
48
+ ...globals.nodeBuiltin
49
+ } },
50
+ rules: {
51
+ ...config.license ? { "header/header": ["error", "file" in config.license ? { files: [config.license.file] } : { text: "shared" in config.license ? Licenses[config.license.shared] : config.license.text }] } : {},
52
+ "no-undef": "off",
53
+ "no-redeclare": "off",
54
+ "@typescript-eslint/no-redeclare": "error",
55
+ "unused-imports/no-unused-imports": "error",
56
+ "no-unused-vars": "off",
57
+ "@typescript-eslint/no-unused-vars": "off",
58
+ "unused-imports/no-unused-vars": ["warn", {
59
+ vars: "all",
60
+ varsIgnorePattern: "^_",
61
+ args: "after-used",
62
+ argsIgnorePattern: "^_"
63
+ }],
64
+ "no-restricted-imports": ["error", { paths: [{
65
+ name: "discord.js",
66
+ importNames: ["Colors"],
67
+ message: "Use StyledColors instead"
68
+ }] }],
69
+ "no-restricted-syntax": ["error", {
70
+ selector: "Literal[raw=/^0x/i]",
71
+ message: "Use StyledColors instead"
72
+ }]
67
73
  }
68
- ]);
74
+ }]);
69
75
  }
70
76
  // src/oxfmt.ts
71
77
  const defaultConfig = Object.freeze({});
72
78
  function oxfmt(config = defaultConfig) {
73
79
  return defineConfig$1({
74
- ignorePatterns: ["dist/**/*"],
80
+ ignorePatterns: [...config.extraIgnores ? config.extraIgnores : [], ...sharedIgnores.map((i) => `${i}/**/*`)],
75
81
  tabWidth: config.rumiMode ? 4 : 2,
76
82
  useTabs: config.rumiMode
77
83
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyssalfragments/linter-config",
3
- "version": "1.1.1",
3
+ "version": "1.2.1",
4
4
  "description": "Abyssal Fragments shared linter config (eslint, prettier, etc)",
5
5
  "bugs": {
6
6
  "url": "https://git.abyssalfragments.org/packages/linter-config/issues"
@@ -51,4 +51,4 @@
51
51
  "eslint": "^10.0.0",
52
52
  "oxfmt": "^0.78.0"
53
53
  }
54
- }
54
+ }