@nokkvireyr/vue-config 1.2.0 → 2.0.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/main.js CHANGED
@@ -1,77 +1,101 @@
1
- import o from "@eslint/js";
2
- import e from "typescript-eslint";
3
- import s from "eslint-plugin-vue";
4
- import i from "globals";
5
- import a from "eslint-config-prettier";
6
- const f = ({
7
- globals: r = {},
8
- rules: t = {},
9
- ignores: n = []
10
- } = {}) => e.config(
11
- // @ts-ignore
12
- { ignores: ["**/dist", ...n] },
13
- {
14
- extends: [
15
- o.configs.recommended,
16
- ...e.configs.recommended,
17
- ...s.configs["flat/recommended"]
18
- ],
19
- files: ["**/*.{ts,vue,js}"],
20
- languageOptions: {
21
- ecmaVersion: "latest",
22
- sourceType: "module",
23
- globals: { ...i.browser, ...r },
24
- parserOptions: {
25
- parser: e.parser
26
- }
27
- },
28
- rules: {
29
- "no-console": ["warn", { allow: ["warn", "error"] }],
30
- "no-debugger": "warn",
31
- "no-unused-vars": "off",
32
- "@typescript-eslint/no-unused-vars": [
33
- "warn",
34
- // or "error"
35
- {
36
- argsIgnorePattern: "^_",
37
- varsIgnorePattern: "^_",
38
- caughtErrorsIgnorePattern: "^_"
39
- }
40
- ],
41
- "no-undef": "off",
42
- "vue/multi-word-component-names": "off",
43
- "prefer-const": "error",
44
- "vue/camelcase": "error",
45
- "vue/attribute-hyphenation": ["error", "never"],
46
- "vue/custom-event-name-casing": ["error", "camelCase"],
47
- "vue/v-on-event-hyphenation": ["error", "never", { autofix: !0 }],
48
- "@typescript-eslint/ban-ts-comment": "off",
49
- "@typescript-eslint/no-explicit-any": "off",
50
- "vue/html-self-closing": [
51
- "warn",
52
- {
53
- html: {
54
- void: "always",
55
- normal: "always"
56
- },
57
- svg: "always",
58
- math: "always"
59
- }
60
- ],
61
- ...t
62
- }
63
- },
64
- a
65
- ), g = {
66
- $schema: "https://json.schemastore.org/prettierrc",
67
- semi: !0,
68
- tabWidth: 2,
69
- singleQuote: !0,
70
- printWidth: 100,
71
- trailingComma: "es5",
72
- plugins: ["prettier-plugin-tailwindcss"]
73
- };
74
- export {
75
- f as eslintConfig,
76
- g as prettierConfig
77
- };
1
+ import e from "@eslint/js";
2
+ import t from "typescript-eslint";
3
+ import n from "eslint-plugin-vue";
4
+ import r from "globals";
5
+ import i from "eslint-config-prettier";
6
+ //#region src/lint/lint.ts
7
+ var a = ({ globals: a = {}, rules: o = {}, ignores: s = [], oxlintPlugin: c = void 0 } = {}) => t.config({ ignores: ["**/dist", ...s] }, {
8
+ extends: [
9
+ e.configs.recommended,
10
+ ...t.configs.recommended,
11
+ ...n.configs["flat/recommended"]
12
+ ],
13
+ files: ["**/*.{ts,vue,js}"],
14
+ languageOptions: {
15
+ ecmaVersion: "latest",
16
+ sourceType: "module",
17
+ globals: {
18
+ ...r.browser,
19
+ ...a
20
+ },
21
+ parserOptions: { parser: t.parser }
22
+ },
23
+ rules: {
24
+ "no-console": ["warn", { allow: ["warn", "error"] }],
25
+ "no-debugger": "warn",
26
+ "no-unused-vars": "off",
27
+ "@typescript-eslint/no-unused-vars": ["warn", {
28
+ argsIgnorePattern: "^_",
29
+ varsIgnorePattern: "^_",
30
+ caughtErrorsIgnorePattern: "^_"
31
+ }],
32
+ "no-undef": "off",
33
+ "vue/multi-word-component-names": "off",
34
+ "prefer-const": "error",
35
+ "vue/camelcase": "error",
36
+ "vue/attribute-hyphenation": ["error", "never"],
37
+ "vue/custom-event-name-casing": ["error", "camelCase"],
38
+ "vue/v-on-event-hyphenation": [
39
+ "error",
40
+ "never",
41
+ { autofix: !0 }
42
+ ],
43
+ "@typescript-eslint/ban-ts-comment": "off",
44
+ "@typescript-eslint/no-explicit-any": "off",
45
+ "vue/html-self-closing": ["warn", {
46
+ html: {
47
+ void: "always",
48
+ normal: "always"
49
+ },
50
+ svg: "always",
51
+ math: "always"
52
+ }],
53
+ ...o
54
+ }
55
+ }, i, ...c ? [c.configs["flat/recommended"]] : []), o = {
56
+ $schema: "https://json.schemastore.org/prettierrc",
57
+ semi: !0,
58
+ tabWidth: 2,
59
+ singleQuote: !0,
60
+ printWidth: 100,
61
+ trailingComma: "es5",
62
+ plugins: ["prettier-plugin-tailwindcss"]
63
+ }, s = ({ plugins: e = [], categories: t = {}, rules: n = {}, globals: r = {}, ignorePatterns: i = [], overrides: a = [] } = {}) => ({
64
+ plugins: [
65
+ "typescript",
66
+ "vue",
67
+ ...(e || []).filter((e) => e !== "typescript" && e !== "vue").filter(Boolean)
68
+ ],
69
+ categories: {
70
+ correctness: "warn",
71
+ ...t
72
+ },
73
+ rules: {
74
+ "no-console": "warn",
75
+ "no-debugger": "warn",
76
+ "prefer-const": "error",
77
+ "typescript/no-unused-vars": ["warn", {
78
+ argsIgnorePattern: "^_",
79
+ varsIgnorePattern: "^_",
80
+ caughtErrorsIgnorePattern: "^_"
81
+ }],
82
+ "typescript/no-explicit-any": "off",
83
+ "typescript/ban-ts-comment": "off",
84
+ "vue/multi-word-component-names": "off",
85
+ ...n
86
+ },
87
+ env: { browser: !0 },
88
+ globals: r,
89
+ ignorePatterns: ["dist/**", ...i],
90
+ overrides: a
91
+ }), c = (e = {}) => ({
92
+ semi: !0,
93
+ tabWidth: 2,
94
+ singleQuote: !0,
95
+ printWidth: 100,
96
+ trailingComma: "es5",
97
+ sortTailwindcss: {},
98
+ ...e
99
+ });
100
+ //#endregion
101
+ export { a as eslintConfig, c as oxfmtConfig, s as oxlintConfig, o as prettierConfig };
@@ -1,8 +1,17 @@
1
+ import type { Linter } from 'eslint';
1
2
  export type OptionRules = 'off' | 'warn' | 'error' | 'never';
2
3
  export type Rules = Record<string, Omit<OptionRules, 'never'> | (OptionRules | Record<string, unknown>)[]>;
3
- export declare const eslintConfig: ({ globals, rules, ignores, }?: {
4
+ /** Pass the imported `eslint-plugin-oxlint` module to disable rules already covered by oxlint. */
5
+ type OxlintPlugin = {
6
+ configs: Record<string, Linter.Config>;
7
+ buildFromOxlintConfigFile?: (path: string) => Linter.Config[];
8
+ buildFromOxlintConfig?: (config: Record<string, unknown>) => Linter.Config[];
9
+ };
10
+ export declare const eslintConfig: ({ globals, rules, ignores, oxlintPlugin, }?: {
4
11
  globals?: Record<string, "readonly" | "writable">;
5
12
  rules?: Rules;
6
13
  ignores?: string[];
14
+ oxlintPlugin?: OxlintPlugin;
7
15
  }) => TSESLint.FlatConfig.ConfigArray;
16
+ export {};
8
17
  //# sourceMappingURL=lint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../../src/lint/lint.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAC7D,MAAM,MAAM,KAAK,GAAG,MAAM,CACxB,MAAM,EACN,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CACvE,CAAC;AAEF,eAAO,MAAM,YAAY;;;;qCA2DtB,CAAC"}
1
+ {"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../../src/lint/lint.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AAC7D,MAAM,MAAM,KAAK,GAAG,MAAM,CACxB,MAAM,EACN,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CACvE,CAAC;AAEF,kGAAkG;AAClG,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACvC,yBAAyB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC;IAC9D,qBAAqB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC;CAC9E,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;qCA6DtB,CAAC"}
@@ -1,3 +1,5 @@
1
1
  export * from './lint/lint';
2
2
  export * from './prettier/prettier';
3
+ export * from './oxlint/oxlint';
4
+ export * from './oxfmt/oxfmt';
3
5
  //# sourceMappingURL=main.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { OxfmtConfig } from 'oxfmt';
2
+ /**
3
+ * Returns an oxfmt config object to spread into `defineConfig()` in your `oxfmt.config.ts`.
4
+ *
5
+ * @example
6
+ * // oxfmt.config.ts
7
+ * import { defineConfig } from 'oxfmt';
8
+ * import { oxfmtConfig } from '@nokkvireyr/vue-config';
9
+ * export default defineConfig(oxfmtConfig());
10
+ */
11
+ export declare const oxfmtConfig: (overrides?: OxfmtConfig) => OxfmtConfig;
12
+ //# sourceMappingURL=oxfmt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oxfmt.d.ts","sourceRoot":"","sources":["../../../src/oxfmt/oxfmt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,eAAe,WAAW,KAAQ,WAQxD,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { OxlintConfig } from 'oxlint';
2
+ export declare const oxlintConfig: ({ plugins, categories, rules, globals, ignorePatterns, overrides, }?: {
3
+ plugins?: ("eslint" | "react" | "unicorn" | "typescript" | "oxc" | "import" | "jsdoc" | "jest" | "vitest" | "jsx-a11y" | "nextjs" | "react-perf" | "promise" | "node" | "vue")[];
4
+ categories?: import("oxlint").RuleCategories;
5
+ rules?: import("oxlint").DummyRuleMap;
6
+ globals?: import("oxlint").OxlintGlobals;
7
+ ignorePatterns?: string[];
8
+ overrides?: import("oxlint").OxlintOverride[];
9
+ }) => OxlintConfig;
10
+ //# sourceMappingURL=oxlint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oxlint.d.ts","sourceRoot":"","sources":["../../../src/oxlint/oxlint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAOtC,eAAO,MAAM,YAAY;;;;;;;MAOhB,YA+BP,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,11 @@
1
1
  {
2
2
  "name": "@nokkvireyr/vue-config",
3
- "version": "1.2.0",
3
+ "version": "2.0.0",
4
4
  "description": "",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/nokkvireyr/vue-config"
8
+ },
5
9
  "main": "dist/main.js",
6
10
  "type": "module",
7
11
  "module": "dist/main.js",
@@ -12,7 +16,8 @@
12
16
  "scripts": {
13
17
  "test": "echo \"Error: no test specified\" && exit 1",
14
18
  "build": "tsc -P ./tsconfig.decleration.json && vite build",
15
- "lint": "eslint src/**/*.{ts,tsx,vue}"
19
+ "lint": "oxlint",
20
+ "lint:fix": "oxlint --fix"
16
21
  },
17
22
  "keywords": [],
18
23
  "author": "",
@@ -21,26 +26,71 @@
21
26
  "@eslint/js": ">=9.0.0",
22
27
  "eslint": ">=9.0.0",
23
28
  "eslint-config-prettier": ">=10.0.0",
29
+ "eslint-plugin-oxlint": ">=0.0.0",
24
30
  "eslint-plugin-vue": ">=9.0.0",
25
31
  "globals": ">=14.0.0",
32
+ "oxfmt": ">=0.4.0",
33
+ "oxlint": ">=1.0.0",
26
34
  "prettier": ">=3.0.0",
27
35
  "prettier-plugin-tailwindcss": ">=0.6.0",
28
36
  "typescript-eslint": ">=8.0.0",
29
37
  "vue-eslint-parser": "^9.4.3"
30
38
  },
39
+ "peerDependenciesMeta": {
40
+ "@eslint/js": {
41
+ "optional": true
42
+ },
43
+ "eslint": {
44
+ "optional": true
45
+ },
46
+ "eslint-config-prettier": {
47
+ "optional": true
48
+ },
49
+ "eslint-plugin-oxlint": {
50
+ "optional": true
51
+ },
52
+ "eslint-plugin-vue": {
53
+ "optional": true
54
+ },
55
+ "globals": {
56
+ "optional": true
57
+ },
58
+ "oxfmt": {
59
+ "optional": true
60
+ },
61
+ "oxlint": {
62
+ "optional": true
63
+ },
64
+ "prettier": {
65
+ "optional": true
66
+ },
67
+ "prettier-plugin-tailwindcss": {
68
+ "optional": true
69
+ },
70
+ "typescript-eslint": {
71
+ "optional": true
72
+ },
73
+ "vue-eslint-parser": {
74
+ "optional": true
75
+ }
76
+ },
31
77
  "devDependencies": {
32
78
  "@eslint/js": "^9.20.0",
33
79
  "@types/eslint-config-prettier": "^6.11.3",
34
80
  "@types/node": "^20.13.0",
35
81
  "eslint": "^9.20.0",
36
82
  "eslint-config-prettier": "^10.0.1",
83
+ "eslint-plugin-oxlint": "^0.18.0",
37
84
  "eslint-plugin-vue": "^9.32.0",
38
85
  "globals": "^16.0.0",
86
+ "oxfmt": "^0.41.0",
87
+ "oxlint": "^1.56.0",
88
+ "oxlint-tsgolint": "^0.17.0",
39
89
  "prettier": "^3.5.0",
40
90
  "prettier-plugin-tailwindcss": "^0.6.11",
41
91
  "typescript": "^5.4.5",
42
92
  "typescript-eslint": "^8.24.1",
43
- "vite": "^5.2.12",
93
+ "vite": "^8.0.0",
44
94
  "vue-eslint-parser": "^9.4.3"
45
95
  }
46
96
  }