@hiddenability/opinionated-defaults 0.1.3 → 0.1.4

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.
@@ -0,0 +1,2 @@
1
+ import type { ConfigArray } from "typescript-eslint";
2
+ export declare const eslintConfig: (config: ConfigArray) => ConfigArray;
@@ -1,9 +1,10 @@
1
- import type { ConfigArray } from "typescript-eslint";
2
1
  export { default as eslintConfigAstro } from "./astro";
3
2
  export { default as eslintConfigBase } from "./base";
3
+ export { eslintConfig } from "./config";
4
4
  export { default as eslintConfigElysia } from "./elysia";
5
5
  export { default as eslintConfigFunctional } from "./functional";
6
6
  export { default as eslintConfigNext } from "./next";
7
+ export { default as eslintConfigOxlint } from "./oxlint";
7
8
  export { default as eslintConfigPerfectionist } from "./perfectionist";
8
9
  export { default as eslintConfigPrettier } from "./prettier";
9
10
  export { default as eslintConfigReact } from "./react";
@@ -12,4 +13,3 @@ export { default as eslintConfigSolid } from "./solid";
12
13
  export { default as eslintConfigStylistic } from "./stylistic";
13
14
  export { default as eslintConfigTurbo } from "./turbo";
14
15
  export { default as eslintConfigTypescript } from "./typescript";
15
- export declare const eslintConfig: (config: ConfigArray) => ConfigArray;
@@ -0,0 +1 @@
1
+ import A from"eslint-plugin-astro";import m from"@eslint/js";import l from"eslint-plugin-prefer-arrow-functions";import g from"eslint-plugin-unicorn";var c=[{ignores:["**/dist/","**/node_modules/","**/.direnv/","**/.git/"]},{files:["**/*.ts","**/*.js","**/*.mjs","**/*.mts","**/*.tsx","**/*.jsx"]},m.configs.recommended,g.configs.recommended,{rules:{"unicorn/filename-case":["error",{cases:{kebabCase:!0}}],"unicorn/no-array-for-each":["off"],"unicorn/no-array-reduce":["off"],"unicorn/prevent-abbreviations":["off"]}},{plugins:{"prefer-arrow-functions":l},rules:{"prefer-arrow-functions/prefer-arrow-functions":["error",{returnStyle:"implicit"}]}},{rules:{"no-console":"warn",quotes:["warn","backtick",{avoidEscape:!0}]}}],t=c;import y from"eslint-plugin-no-relative-import-paths";var C=[{plugins:{"no-relative-import-paths":y},rules:{"no-relative-import-paths/no-relative-import-paths":["error",{prefix:"@"}]}}],r=C;import u from"@typescript-eslint/parser";import d from"typescript-eslint";var x=[...d.configs.recommendedTypeChecked,{languageOptions:{parser:u,parserOptions:{projectService:!0}}},{rules:{"@typescript-eslint/no-unused-vars":["error",{args:"all",argsIgnorePattern:"^_",caughtErrors:"all",caughtErrorsIgnorePattern:"^_",destructuredArrayIgnorePattern:"^_",ignoreRestSiblings:!0,varsIgnorePattern:"^_"}],"@typescript-eslint/prefer-nullish-coalescing":"error"}}],o=x;var b=[...t,...o,...r,...A.configs.recommended],R=b;var v=(p)=>p;import e from"eslint-plugin-functional";var w=[e.configs.externalTypeScriptRecommended,e.configs.recommended,e.configs.stylistic,{rules:{"functional/no-expression-statements":["off"],"functional/no-return-void":["off"]}}],i=w;var O=[...t,...o,...i,...r],k=O;import f from"@next/eslint-plugin-next";import s from"eslint-plugin-react";import N from"eslint-plugin-react-hooks";var S=[s.configs.flat.recommended,s.configs.flat["jsx-runtime"],N.configs["recommended-latest"]],n=S;var T=[...t,...n,...r,...o,{plugins:{"@next/next":f},rules:{...f.configs.recommended.rules,...f.configs["core-web-vitals"].rules}}],_=T;import j from"eslint-plugin-oxlint";var B=[...j.configs["flat/recommended"]],E=B;import I from"eslint-plugin-perfectionist";var P=[I.configs["recommended-natural"],{rules:{"perfectionist/sort-object-types":["warn",{partitionByNewLine:!0}],"perfectionist/sort-objects":["warn",{partitionByNewLine:!0}]}}],h=P;import L from"eslint-plugin-prettier/recommended";var H=[L,{rules:{"prettier/prettier":"warn",quotes:["warn","backtick",{avoidEscape:!0}]}}],J=H;import q from"eslint-plugin-solid/configs/typescript";var z=[q],D=z;import a from"@stylistic/eslint-plugin";var F=[a.configs.all,{plugins:{"@stylistic":a}}],G=F;import K from"eslint-plugin-turbo";var M=[K.configs["flat/recommended"]],Q=M;export{o as eslintConfigTypescript,Q as eslintConfigTurbo,G as eslintConfigStylistic,D as eslintConfigSolid,r as eslintConfigRelative,n as eslintConfigReact,J as eslintConfigPrettier,h as eslintConfigPerfectionist,E as eslintConfigOxlint,_ as eslintConfigNext,i as eslintConfigFunctional,k as eslintConfigElysia,t as eslintConfigBase,R as eslintConfigAstro,v as eslintConfig};
@@ -0,0 +1,3 @@
1
+ import type { ConfigArray } from "typescript-eslint";
2
+ declare const eslintConfigOxlint: ConfigArray;
3
+ export default eslintConfigOxlint;
@@ -0,0 +1,2 @@
1
+ import type { Config } from "prettier";
2
+ export declare const prettierConfig: (source: Config, ...sources: Config[]) => Config;
@@ -1,5 +1,5 @@
1
1
  export { default as prettierConfigAstro } from "./astro";
2
2
  export { default as prettierConfigBase } from "./base";
3
- export { merge as prettierConfig } from "./merge";
3
+ export { prettierConfig } from "./config";
4
4
  export { default as prettierConfigSortImports } from "./sort-imports";
5
5
  export { default as prettierConfigTailwind } from "./tailwind";
@@ -0,0 +1 @@
1
+ var n={arrowParens:"always",bracketSameLine:!1,bracketSpacing:!0,experimentalTernaries:!0,jsxSingleQuote:!0,semi:!0,singleQuote:!0,tabWidth:2,trailingComma:"all",useTabs:!1},p=n;import t from"lodash";var f=t.isArray.bind(t),g=t.mergeWith.bind(t),a=t.union.bind(t),m=(e,o)=>{if(!f(e)||!f(o))return;let i=a(e,o);if(i.includes("prettier-plugin-tailwindcss"))i.push(i.splice(i.indexOf("prettier-plugin-tailwindcss"),1)[0]);return i},r=(e,...o)=>g({},e,...o,m);var s=r({overrides:[{files:"*.astro",options:{parser:"astro"}}],plugins:["prettier-plugin-astro"]},p),l=s;var C={importOrderSeparation:!0,importOrderSortSpecifiers:!0,plugins:["@trivago/prettier-plugin-sort-imports"]},u=C;var x={plugins:["prettier-plugin-tailwindcss"],tailwindFunctions:["cva","clsx","cn"]},d=x;export{d as prettierConfigTailwind,u as prettierConfigSortImports,p as prettierConfigBase,l as prettierConfigAstro,r as prettierConfig};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hiddenability/opinionated-defaults",
3
3
  "description": "Opinionated default configurations for webdev tools.",
4
- "version": "0.1.3",
4
+ "version": "0.1.4",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -9,21 +9,20 @@
9
9
  },
10
10
  "type": "module",
11
11
  "scripts": {
12
- "build": "bun test && bun build.ts",
13
- "prepack": "bun test && bun build.ts",
14
- "test": "bun test",
15
- "lint": "eslint",
16
- "lint:fix": "eslint --fix",
12
+ "build": "bun test && bun ./scripts/build.ts",
13
+ "prepack": "bun test && bun ./scripts/build.ts",
14
+ "lint": "oxlint && eslint_d",
15
+ "lint:fix": "oxlint --fix --fix-suggestions && eslint_d --fix",
17
16
  "format": "prettier . -c",
18
17
  "format:fix": "prettier . -w"
19
18
  },
20
19
  "exports": {
21
20
  "./eslint": {
22
- "import": "./dist/eslint/index.js",
21
+ "default": "./dist/eslint/index.mjs",
23
22
  "types": "./dist/eslint/index.d.ts"
24
23
  },
25
24
  "./prettier": {
26
- "import": "./dist/prettier/index.js",
25
+ "default": "./dist/prettier/index.mjs",
27
26
  "types": "./dist/prettier/index.d.ts"
28
27
  }
29
28
  },
@@ -31,36 +30,39 @@
31
30
  "dist"
32
31
  ],
33
32
  "dependencies": {
33
+ "@eslint/compat": "^1.3.1",
34
34
  "@eslint/js": "^9.31.0",
35
- "@next/eslint-plugin-next": "^15.4.1",
36
- "@stylistic/eslint-plugin": "^5.2.0",
35
+ "@next/eslint-plugin-next": "^15.4.2-canary.15",
36
+ "@stylistic/eslint-plugin": "^5.2.2",
37
37
  "@trivago/prettier-plugin-sort-imports": "^5.2.2",
38
- "@types/lodash": "^4.17.20",
39
- "eslint": "^9.31.0",
40
- "eslint-config-prettier": "^10.1.5",
38
+ "eslint-config-prettier": "^10.1.8",
41
39
  "eslint-plugin-astro": "^1.3.1",
42
40
  "eslint-plugin-functional": "^9.0.2",
43
41
  "eslint-plugin-import": "^2.32.0",
44
42
  "eslint-plugin-no-relative-import-paths": "^1.6.1",
43
+ "eslint-plugin-oxlint": "^1.8.0",
45
44
  "eslint-plugin-perfectionist": "^4.15.0",
46
45
  "eslint-plugin-prefer-arrow-functions": "^3.6.2",
47
- "eslint-plugin-prettier": "^5.5.1",
46
+ "eslint-plugin-prettier": "^5.5.3",
48
47
  "eslint-plugin-react": "^7.37.5",
49
48
  "eslint-plugin-react-hooks": "^5.2.0",
50
49
  "eslint-plugin-solid": "^0.14.5",
51
50
  "eslint-plugin-turbo": "^2.5.5",
52
- "eslint-plugin-unicorn": "^59.0.1",
53
- "jiti": "^2.4.2",
51
+ "eslint-plugin-unicorn": "^60.0.0",
52
+ "eslint_d": "^14.3.0",
53
+ "jiti": "^2.5.1",
54
54
  "lodash": "^4.17.21",
55
+ "oxlint": "^1.8.0",
55
56
  "prettier": "3.6.2",
56
57
  "prettier-plugin-astro": "^0.14.1",
57
58
  "prettier-plugin-tailwindcss": "0.6.14",
58
- "typescript-eslint": "^8.37.0"
59
+ "typescript-eslint": "^8.38.0"
59
60
  },
60
61
  "devDependencies": {
61
62
  "@hiddenability/opinionated-defaults": "link:@hiddenability/opinionated-defaults",
62
- "@types/bun": "^1.2.18",
63
+ "@types/bun": "^1.2.19",
64
+ "@types/lodash": "^4.17.20",
63
65
  "consola": "^3.4.2",
64
- "oxc-transform": "^0.77.3"
66
+ "oxc-transform": "^0.78.0"
65
67
  }
66
68
  }
@@ -1,240 +0,0 @@
1
- // src/eslint/astro.ts
2
- import eslintPluginAstro from "eslint-plugin-astro";
3
-
4
- // src/eslint/base.ts
5
- import js from "@eslint/js";
6
- import preferArrowFunctions from "eslint-plugin-prefer-arrow-functions";
7
- import eslintPluginUnicorn from "eslint-plugin-unicorn";
8
- var config = [
9
- js.configs.recommended,
10
- eslintPluginUnicorn.configs.recommended,
11
- {
12
- rules: {
13
- "unicorn/filename-case": [
14
- `error`,
15
- {
16
- cases: {
17
- kebabCase: true
18
- }
19
- }
20
- ],
21
- "unicorn/no-array-for-each": [`off`],
22
- "unicorn/no-array-reduce": [`off`],
23
- "unicorn/prevent-abbreviations": [`off`]
24
- }
25
- },
26
- {
27
- plugins: {
28
- "prefer-arrow-functions": preferArrowFunctions
29
- },
30
- rules: {
31
- "prefer-arrow-functions/prefer-arrow-functions": [
32
- `error`,
33
- { returnStyle: `implicit` }
34
- ]
35
- }
36
- },
37
- {
38
- files: [
39
- `**/*.ts`,
40
- `**/*.js`,
41
- `**/*.mjs`,
42
- `**/*.mts`,
43
- `**/*.tsx`,
44
- `**/*.jsx`
45
- ]
46
- },
47
- {
48
- ignores: [`**/dist/`]
49
- },
50
- {
51
- rules: {
52
- "no-console": `warn`,
53
- quotes: [`warn`, `backtick`, { avoidEscape: true }]
54
- }
55
- }
56
- ];
57
- var base_default = config;
58
-
59
- // src/eslint/relative.ts
60
- import noRelativeImportPaths from "eslint-plugin-no-relative-import-paths";
61
- var relativeConfig = [
62
- {
63
- plugins: {
64
- "no-relative-import-paths": noRelativeImportPaths
65
- },
66
- rules: {
67
- "no-relative-import-paths/no-relative-import-paths": [
68
- `error`,
69
- { prefix: `@` }
70
- ]
71
- }
72
- }
73
- ];
74
- var relative_default = relativeConfig;
75
-
76
- // src/eslint/typescript.ts
77
- import parser from "@typescript-eslint/parser";
78
- import tseslint from "typescript-eslint";
79
- var typescriptConfig = [
80
- ...tseslint.configs.recommended,
81
- {
82
- languageOptions: {
83
- parser,
84
- parserOptions: {
85
- projectService: true
86
- }
87
- }
88
- },
89
- {
90
- rules: {
91
- "@typescript-eslint/no-unused-vars": [
92
- `error`,
93
- {
94
- args: `all`,
95
- argsIgnorePattern: `^_`,
96
- caughtErrors: `all`,
97
- caughtErrorsIgnorePattern: `^_`,
98
- destructuredArrayIgnorePattern: `^_`,
99
- ignoreRestSiblings: true,
100
- varsIgnorePattern: `^_`
101
- }
102
- ]
103
- }
104
- }
105
- ];
106
- var typescript_default = typescriptConfig;
107
-
108
- // src/eslint/astro.ts
109
- var astroConfig = [
110
- ...base_default,
111
- ...typescript_default,
112
- ...relative_default,
113
- ...eslintPluginAstro.configs.recommended
114
- ];
115
- var astro_default = astroConfig;
116
- // src/eslint/functional.ts
117
- import functional from "eslint-plugin-functional";
118
- var functionalConfig = [
119
- functional.configs.externalTypeScriptRecommended,
120
- functional.configs.recommended,
121
- functional.configs.stylistic,
122
- {
123
- rules: {
124
- "functional/no-expression-statements": [`off`],
125
- "functional/no-return-void": [`off`]
126
- }
127
- }
128
- ];
129
- var functional_default = functionalConfig;
130
-
131
- // src/eslint/elysia.ts
132
- var elysiaConfig = [
133
- ...base_default,
134
- ...typescript_default,
135
- ...functional_default,
136
- ...relative_default
137
- ];
138
- var elysia_default = elysiaConfig;
139
- // src/eslint/next.ts
140
- import pluginNext from "@next/eslint-plugin-next";
141
-
142
- // src/eslint/react.ts
143
- import pluginReact from "eslint-plugin-react";
144
- import pluginReactHooks from "eslint-plugin-react-hooks";
145
- var reactConfig = [
146
- pluginReact.configs.flat[`recommended`],
147
- pluginReact.configs.flat[`jsx-runtime`],
148
- pluginReactHooks.configs[`recommended-latest`]
149
- ];
150
- var react_default = reactConfig;
151
-
152
- // src/eslint/next.ts
153
- var nextJsConfig = [
154
- ...base_default,
155
- ...react_default,
156
- ...relative_default,
157
- ...typescript_default,
158
- {
159
- plugins: {
160
- "@next/next": pluginNext
161
- },
162
- rules: {
163
- ...pluginNext.configs.recommended.rules,
164
- ...pluginNext.configs[`core-web-vitals`].rules
165
- }
166
- }
167
- ];
168
- var next_default = nextJsConfig;
169
- // src/eslint/perfectionist.ts
170
- import perfectionist from "eslint-plugin-perfectionist";
171
- var perfectionistConfig = [
172
- perfectionist.configs[`recommended-natural`],
173
- {
174
- rules: {
175
- "perfectionist/sort-object-types": [
176
- `warn`,
177
- {
178
- partitionByNewLine: true
179
- }
180
- ],
181
- "perfectionist/sort-objects": [
182
- `warn`,
183
- {
184
- partitionByNewLine: true
185
- }
186
- ]
187
- }
188
- }
189
- ];
190
- var perfectionist_default = perfectionistConfig;
191
- // src/eslint/prettier.ts
192
- import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
193
- var eslintPrettierConfig = [
194
- eslintPluginPrettierRecommended,
195
- {
196
- rules: {
197
- "prettier/prettier": `warn`,
198
- quotes: [`warn`, `backtick`, { avoidEscape: true }]
199
- }
200
- }
201
- ];
202
- var prettier_default = eslintPrettierConfig;
203
- // src/eslint/solid.ts
204
- import eslintPluginSolid from "eslint-plugin-solid/configs/typescript";
205
- var solidConfig = [eslintPluginSolid];
206
- var solid_default = solidConfig;
207
- // src/eslint/stylistic.ts
208
- import stylistic from "@stylistic/eslint-plugin";
209
- var stylisticConfig = [
210
- stylistic.configs.all,
211
- {
212
- plugins: {
213
- "@stylistic": stylistic
214
- }
215
- }
216
- ];
217
- var stylistic_default = stylisticConfig;
218
- // src/eslint/turbo.ts
219
- import turboPlugin from "eslint-plugin-turbo";
220
- var turborepoConfig = [turboPlugin.configs[`flat/recommended`]];
221
- var turbo_default = turborepoConfig;
222
-
223
- // src/eslint/index.ts
224
- var eslintConfig = (config2) => config2;
225
- export {
226
- typescript_default as eslintConfigTypescript,
227
- turbo_default as eslintConfigTurbo,
228
- stylistic_default as eslintConfigStylistic,
229
- solid_default as eslintConfigSolid,
230
- relative_default as eslintConfigRelative,
231
- react_default as eslintConfigReact,
232
- prettier_default as eslintConfigPrettier,
233
- perfectionist_default as eslintConfigPerfectionist,
234
- next_default as eslintConfigNext,
235
- functional_default as eslintConfigFunctional,
236
- elysia_default as eslintConfigElysia,
237
- base_default as eslintConfigBase,
238
- astro_default as eslintConfigAstro,
239
- eslintConfig
240
- };
@@ -1,63 +0,0 @@
1
- // src/prettier/astro.ts
2
- import lodash from "lodash";
3
-
4
- // src/prettier/base.ts
5
- var config = {
6
- arrowParens: `always`,
7
- bracketSameLine: false,
8
- bracketSpacing: true,
9
- experimentalTernaries: true,
10
- jsxSingleQuote: true,
11
- semi: true,
12
- singleQuote: true,
13
- tabWidth: 2,
14
- trailingComma: `all`,
15
- useTabs: false
16
- };
17
- var base_default = config;
18
-
19
- // src/prettier/astro.ts
20
- var { merge } = lodash;
21
- var astroConfig = merge({
22
- overrides: [
23
- {
24
- files: `*.astro`,
25
- options: { parser: `astro` }
26
- }
27
- ],
28
- plugins: [`prettier-plugin-astro`]
29
- }, base_default);
30
- var astro_default = astroConfig;
31
- // src/prettier/merge.ts
32
- import lodash2 from "lodash";
33
- var { isArray, mergeWith, union } = lodash2;
34
- var arrayMerge = (arr1, arr2) => {
35
- if (!isArray(arr1) || !isArray(arr2))
36
- return;
37
- const retArr = union(arr1, arr2);
38
- if (retArr.includes(`prettier-plugin-tailwindcss`)) {
39
- retArr.push(retArr.splice(retArr.indexOf(`prettier-plugin-tailwindcss`), 1)[0]);
40
- }
41
- return retArr;
42
- };
43
- var merge2 = (source, ...sources) => mergeWith({}, source, ...sources, arrayMerge);
44
- // src/prettier/sort-imports.ts
45
- var sortConfig = {
46
- importOrderSeparation: true,
47
- importOrderSortSpecifiers: true,
48
- plugins: [`@trivago/prettier-plugin-sort-imports`]
49
- };
50
- var sort_imports_default = sortConfig;
51
- // src/prettier/tailwind.ts
52
- var tailwindConfig = {
53
- plugins: [`prettier-plugin-tailwindcss`],
54
- tailwindFunctions: [`cva`, `clsx`, `cn`]
55
- };
56
- var tailwind_default = tailwindConfig;
57
- export {
58
- tailwind_default as prettierConfigTailwind,
59
- sort_imports_default as prettierConfigSortImports,
60
- base_default as prettierConfigBase,
61
- astro_default as prettierConfigAstro,
62
- merge2 as prettierConfig
63
- };
@@ -1,2 +0,0 @@
1
- import type { Config } from "prettier";
2
- export declare const merge: (source: Config, ...sources: Config[]) => Config;