@abyssalfragments/linter-config 1.2.0 → 1.3.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 +2 -0
- package/dist/index.mjs +44 -42
- package/package.json +12 -2
package/dist/index.d.mts
CHANGED
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";
|
|
@@ -31,47 +31,47 @@ const sharedIgnores = [
|
|
|
31
31
|
// src/eslint.ts
|
|
32
32
|
const defaultConfig$1 = Object.freeze({});
|
|
33
33
|
function eslint(config = defaultConfig$1) {
|
|
34
|
-
return defineConfig([
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
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
|
+
}]
|
|
73
73
|
}
|
|
74
|
-
]);
|
|
74
|
+
}]);
|
|
75
75
|
}
|
|
76
76
|
// src/oxfmt.ts
|
|
77
77
|
const defaultConfig = Object.freeze({});
|
|
@@ -79,7 +79,9 @@ function oxfmt(config = defaultConfig) {
|
|
|
79
79
|
return defineConfig$1({
|
|
80
80
|
ignorePatterns: [...config.extraIgnores ? config.extraIgnores : [], ...sharedIgnores.map((i) => `${i}/**/*`)],
|
|
81
81
|
tabWidth: config.rumiMode ? 4 : 2,
|
|
82
|
-
useTabs: config.rumiMode
|
|
82
|
+
useTabs: config.rumiMode,
|
|
83
|
+
astro: true,
|
|
84
|
+
svelte: true
|
|
83
85
|
});
|
|
84
86
|
}
|
|
85
87
|
export { SharedLicense, eslint, oxfmt };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abyssalfragments/linter-config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.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"
|
|
@@ -48,7 +48,17 @@
|
|
|
48
48
|
"typescript": "6.0.3"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
+
"@astrojs/compiler-rs": "^0.5.0",
|
|
51
52
|
"eslint": "^10.0.0",
|
|
52
|
-
"oxfmt": "^0.78.0"
|
|
53
|
+
"oxfmt": "^0.78.0",
|
|
54
|
+
"svelte": "^5.0.0"
|
|
55
|
+
},
|
|
56
|
+
"peerDependenciesMeta": {
|
|
57
|
+
"@astrojs/compiler-rs": {
|
|
58
|
+
"optional": true
|
|
59
|
+
},
|
|
60
|
+
"svelte": {
|
|
61
|
+
"optional": true
|
|
62
|
+
}
|
|
53
63
|
}
|
|
54
64
|
}
|