@abyssalfragments/linter-config 1.0.1 → 1.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 CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  Shared ESLint and Oxfmt configurations for Abyssal Fragments projects.
4
4
 
5
- Developed on [Forgejo](https://git.abyssalfragments.org/packages/linter-config)
5
+ Developed on [Forgejo](https://git.abyssalfragments.org/packages/linter-config)
package/dist/index.d.mts CHANGED
@@ -1,14 +1,22 @@
1
- type EslintConfigLicense = {
2
- text: string | string[];
3
- } | {
4
- file: string;
1
+ export declare enum SharedLicense {
2
+ PRIVATE = "private",
3
+ PRIVATE_MEDIA = "private-media",
4
+ MIT = "mit"
5
+ }
6
+ type SharedConfig = {
7
+ extraIgnores?: string[];
5
8
  };
6
- type EslintConfig = {
7
- discord?: boolean;
8
- license?: EslintConfigLicense;
9
+ type EslintConfig = SharedConfig & {
10
+ license?: {
11
+ text: string | string[];
12
+ } | {
13
+ file: string;
14
+ } | {
15
+ shared: SharedLicense;
16
+ };
9
17
  };
10
18
  declare function eslint(config?: EslintConfig): import("eslint/config").ConfigObject[];
11
- type OxfmtConfig = {
19
+ type OxfmtConfig = SharedConfig & {
12
20
  /** Uses tabs over spaces */
13
21
  rumiMode?: boolean;
14
22
  };
package/dist/index.mjs CHANGED
@@ -6,11 +6,33 @@ import { defineConfig, globalIgnores } from "eslint/config";
6
6
  import header from "eslint-plugin-simple-header";
7
7
  import eslintConfigPrettier from "eslint-config-prettier/flat";
8
8
  import { defineConfig as defineConfig$1 } from "oxfmt";
9
+ // src/license.ts
10
+ let SharedLicense = /* @__PURE__ */ function(SharedLicense) {
11
+ SharedLicense["PRIVATE"] = "private";
12
+ SharedLicense["PRIVATE_MEDIA"] = "private-media";
13
+ SharedLicense["MIT"] = "mit";
14
+ return SharedLicense;
15
+ }({});
16
+ const Licenses = {
17
+ ["private"]: ["Copyright (c) 2026 Abyssal Fragments", "Unauthorized copying or distribution is strictly prohibited."].join("\n\n"),
18
+ ["private-media"]: [
19
+ "Copyright (c) 2026 Abyssal Fragments",
20
+ "All code and software assets are the exclusive property of Abyssal Fragments. Unauthorized copying, modification, or distribution of these assets is strictly prohibited.",
21
+ "All images and visual content are the property of their respective owners and are used with permission or under applicable rights."
22
+ ].join("\n\n"),
23
+ ["mit"]: ["Copyright (c) 2026 Abyssal Fragments", "SPDX-License-Identifier: MIT"].join("\n")
24
+ };
25
+ // src/shared.ts
26
+ const sharedIgnores = [
27
+ "dist",
28
+ "build",
29
+ "drizzle"
30
+ ];
9
31
  // src/eslint.ts
10
32
  const defaultConfig$1 = Object.freeze({});
11
33
  function eslint(config = defaultConfig$1) {
12
34
  return defineConfig([
13
- globalIgnores(["dist/*"]),
35
+ globalIgnores([...config.extraIgnores ? config.extraIgnores : [], ...sharedIgnores.map((i) => `${i}/*`)]),
14
36
  tseslint.configs.recommended,
15
37
  {
16
38
  files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
@@ -25,30 +47,28 @@ function eslint(config = defaultConfig$1) {
25
47
  ...globals.nodeBuiltin
26
48
  } },
27
49
  rules: {
28
- ...config.license ? { "header/header": ["error", "file" in config.license ? { files: [config.license.file] } : { text: config.license.text }] } : {},
50
+ ...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 }] } : {},
29
51
  "no-undef": "off",
30
- "@typescript-eslint/no-unused-vars": "off",
31
52
  "no-redeclare": "off",
32
53
  "@typescript-eslint/no-redeclare": "error",
33
- "no-unused-vars": "off",
34
54
  "unused-imports/no-unused-imports": "error",
55
+ "no-unused-vars": "off",
56
+ "@typescript-eslint/no-unused-vars": "off",
35
57
  "unused-imports/no-unused-vars": ["warn", {
36
58
  vars: "all",
37
59
  varsIgnorePattern: "^_",
38
60
  args: "after-used",
39
61
  argsIgnorePattern: "^_"
40
62
  }],
41
- ...config.discord ? {
42
- "no-restricted-imports": ["error", { paths: [{
43
- name: "discord.js",
44
- importNames: ["Colors"],
45
- message: "Use StyledColors instead"
46
- }] }],
47
- "no-restricted-syntax": ["error", {
48
- selector: "Literal[raw=/^0x/i]",
49
- message: "Use StyledColors instead"
50
- }]
51
- } : {}
63
+ "no-restricted-imports": ["error", { paths: [{
64
+ name: "discord.js",
65
+ importNames: ["Colors"],
66
+ message: "Use StyledColors instead"
67
+ }] }],
68
+ "no-restricted-syntax": ["error", {
69
+ selector: "Literal[raw=/^0x/i]",
70
+ message: "Use StyledColors instead"
71
+ }]
52
72
  }
53
73
  }
54
74
  ]);
@@ -57,9 +77,9 @@ function eslint(config = defaultConfig$1) {
57
77
  const defaultConfig = Object.freeze({});
58
78
  function oxfmt(config = defaultConfig) {
59
79
  return defineConfig$1({
60
- ignorePatterns: ["dist/**/*"],
80
+ ignorePatterns: [...config.extraIgnores ? config.extraIgnores : [], ...sharedIgnores.map((i) => `${i}/**/*`)],
61
81
  tabWidth: config.rumiMode ? 4 : 2,
62
82
  useTabs: config.rumiMode
63
83
  });
64
84
  }
65
- export { eslint, oxfmt };
85
+ export { SharedLicense, eslint, oxfmt };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyssalfragments/linter-config",
3
- "version": "1.0.1",
3
+ "version": "1.2.0",
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
+ }