@abyssalfragments/linter-config 1.3.0 → 1.4.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/dist/index.d.mts CHANGED
@@ -1,3 +1,4 @@
1
+ import { OxlintEnv } from "oxlint";
1
2
  export declare enum SharedLicense {
2
3
  PRIVATE = "private",
3
4
  PRIVATE_MEDIA = "private-media",
@@ -26,5 +27,55 @@ declare function oxfmt(config?: OxfmtConfig): {
26
27
  useTabs: boolean | undefined;
27
28
  astro: true;
28
29
  svelte: true;
30
+ sortImports: true;
31
+ sortPackageJson: true;
32
+ sortTailwindcss: true;
33
+ jsdoc: true;
29
34
  };
30
- export { eslint, oxfmt };
35
+ type OxlintConfig = SharedConfig & {
36
+ license?: {
37
+ text: string | string[];
38
+ } | {
39
+ file: string;
40
+ } | {
41
+ shared: SharedLicense;
42
+ };
43
+ env?: OxlintEnv;
44
+ };
45
+ declare function oxlint(config?: OxlintConfig): {
46
+ ignorePatterns: string[];
47
+ jsPlugins: {
48
+ name: string;
49
+ specifier: string;
50
+ }[];
51
+ env: OxlintEnv;
52
+ rules: {
53
+ "no-undef": "off";
54
+ "no-redeclare": "error";
55
+ "no-unused-vars": ["warn", {
56
+ vars: "all";
57
+ varsIgnorePattern: string;
58
+ args: "after-used";
59
+ argsIgnorePattern: string;
60
+ }];
61
+ "no-restricted-imports": ["error", {
62
+ paths: {
63
+ name: string;
64
+ importNames: string[];
65
+ message: string;
66
+ }[];
67
+ }];
68
+ "eslint-js/no-restricted-syntax": ["error", {
69
+ selector: "Literal[raw=/^0x/i]";
70
+ message: "Use StyledColors instead";
71
+ }];
72
+ "header/header"?: ["error", {
73
+ files: string[];
74
+ text?: undefined;
75
+ } | {
76
+ text: string | string[];
77
+ files?: undefined;
78
+ }] | undefined;
79
+ };
80
+ };
81
+ export { eslint, oxfmt, oxlint };
package/dist/index.mjs CHANGED
@@ -1,11 +1,12 @@
1
1
  import js from "@eslint/js";
2
- import ts from "typescript-eslint";
2
+ import eslintConfigPrettier from "eslint-config-prettier/flat";
3
+ import header from "eslint-plugin-simple-header";
3
4
  import unusedImports from "eslint-plugin-unused-imports";
4
- import globals from "globals";
5
5
  import { defineConfig, globalIgnores } from "eslint/config";
6
- import header from "eslint-plugin-simple-header";
7
- import eslintConfigPrettier from "eslint-config-prettier/flat";
6
+ import globals from "globals";
7
+ import ts from "typescript-eslint";
8
8
  import { defineConfig as defineConfig$1 } from "oxfmt";
9
+ import { defineConfig as defineConfig$2 } from "oxlint";
9
10
  // src/license.ts
10
11
  let SharedLicense = /* @__PURE__ */ function(SharedLicense) {
11
12
  SharedLicense["PRIVATE"] = "private";
@@ -29,8 +30,8 @@ const sharedIgnores = [
29
30
  "drizzle"
30
31
  ];
31
32
  // src/eslint.ts
32
- const defaultConfig$1 = Object.freeze({});
33
- function eslint(config = defaultConfig$1) {
33
+ const defaultConfig$2 = Object.freeze({});
34
+ function eslint(config = defaultConfig$2) {
34
35
  return defineConfig([globalIgnores([...config.extraIgnores ? config.extraIgnores : [], ...sharedIgnores.map((i) => `${i}/*`)]), {
35
36
  files: ["**/*.{js,mjs,cjs,ts,mts,cts}"],
36
37
  plugins: {
@@ -74,14 +75,56 @@ function eslint(config = defaultConfig$1) {
74
75
  }]);
75
76
  }
76
77
  // src/oxfmt.ts
77
- const defaultConfig = Object.freeze({});
78
- function oxfmt(config = defaultConfig) {
78
+ const defaultConfig$1 = Object.freeze({});
79
+ function oxfmt(config = defaultConfig$1) {
79
80
  return defineConfig$1({
80
81
  ignorePatterns: [...config.extraIgnores ? config.extraIgnores : [], ...sharedIgnores.map((i) => `${i}/**/*`)],
81
82
  tabWidth: config.rumiMode ? 4 : 2,
82
83
  useTabs: config.rumiMode,
83
84
  astro: true,
84
- svelte: true
85
+ svelte: true,
86
+ sortImports: true,
87
+ sortPackageJson: true,
88
+ sortTailwindcss: true,
89
+ jsdoc: true
90
+ });
91
+ }
92
+ // src/oxlint.ts
93
+ const defaultConfig = Object.freeze({});
94
+ function oxlint(config = defaultConfig) {
95
+ return defineConfig$2({
96
+ ignorePatterns: [...config.extraIgnores ? config.extraIgnores : [], ...sharedIgnores.map((i) => `${i}/*`)],
97
+ jsPlugins: [{
98
+ name: "eslint-js",
99
+ specifier: "oxlint-plugin-eslint"
100
+ }, config.license ? {
101
+ name: "header",
102
+ specifier: "eslint-plugin-simple-header"
103
+ } : null].filter((i) => i !== null),
104
+ env: config.env ?? {
105
+ node: true,
106
+ es6: true
107
+ },
108
+ rules: {
109
+ ...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 }] } : {},
110
+ "no-undef": "off",
111
+ "no-redeclare": "error",
112
+ "no-unused-vars": ["warn", {
113
+ vars: "all",
114
+ varsIgnorePattern: "^_",
115
+ args: "after-used",
116
+ argsIgnorePattern: "^_"
117
+ }],
118
+ "no-restricted-imports": ["error", { paths: [{
119
+ name: "discord.js",
120
+ importNames: ["Colors"],
121
+ message: "Use StyledColors instead"
122
+ }] }],
123
+ "eslint-js/no-restricted-syntax": ["error", {
124
+ selector: "Literal[raw=/^0x/i]",
125
+ message: "Use StyledColors instead"
126
+ }]
127
+ }
85
128
  });
86
129
  }
87
- export { SharedLicense, eslint, oxfmt };
130
+ export { SharedLicense, eslint, oxfmt, oxlint };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abyssalfragments/linter-config",
3
- "version": "1.3.0",
3
+ "version": "1.4.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"
@@ -27,7 +27,7 @@
27
27
  "dev": "tsdown --watch",
28
28
  "check": "tsc --noEmit",
29
29
  "prepublishOnly": "npm run build",
30
- "lint": "eslint . && oxfmt --check",
30
+ "lint": "oxlint . && oxfmt --check",
31
31
  "fix": "eslint . --fix",
32
32
  "format": "oxfmt",
33
33
  "lint:dev": "npm run build && npm run lint"
@@ -44,6 +44,8 @@
44
44
  "@types/node": "26.6.6",
45
45
  "eslint": "10.15.0",
46
46
  "oxfmt": "^0.78.0",
47
+ "oxlint": "^1.93.0",
48
+ "oxlint-plugin-eslint": "^1.93.0",
47
49
  "tsdown": "0.23.7",
48
50
  "typescript": "6.0.3"
49
51
  },
@@ -51,6 +53,7 @@
51
53
  "@astrojs/compiler-rs": "^0.5.0",
52
54
  "eslint": "^10.0.0",
53
55
  "oxfmt": "^0.78.0",
56
+ "oxlint": "^1.93.0",
54
57
  "svelte": "^5.0.0"
55
58
  },
56
59
  "peerDependenciesMeta": {