@shayanthenerd/eslint-config 0.4.4 → 0.4.5

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.
Files changed (65) hide show
  1. package/package.json +1 -2
  2. package/dist/configs/base.js +0 -43
  3. package/dist/configs/commons.js +0 -26
  4. package/dist/configs/css.js +0 -28
  5. package/dist/configs/cypress.js +0 -22
  6. package/dist/configs/html.js +0 -22
  7. package/dist/configs/importX.js +0 -45
  8. package/dist/configs/nuxtMultiRootTemplate.js +0 -14
  9. package/dist/configs/oxlintOverrides.js +0 -50
  10. package/dist/configs/perfectionist.js +0 -23
  11. package/dist/configs/playwright.js +0 -22
  12. package/dist/configs/storybook.js +0 -23
  13. package/dist/configs/stylistic.js +0 -22
  14. package/dist/configs/tailwind.js +0 -42
  15. package/dist/configs/typescript.js +0 -30
  16. package/dist/configs/vitest.js +0 -22
  17. package/dist/configs/vue.js +0 -34
  18. package/dist/configs/vueComponentNames.js +0 -19
  19. package/dist/index.d.ts +0 -16
  20. package/dist/index.js +0 -54
  21. package/dist/oxlint.config.jsonc +0 -192
  22. package/dist/prettier.config.d.ts +0 -6
  23. package/dist/prettier.config.js +0 -38
  24. package/dist/rules/css.js +0 -65
  25. package/dist/rules/cypress.js +0 -15
  26. package/dist/rules/html.js +0 -53
  27. package/dist/rules/importX.js +0 -50
  28. package/dist/rules/javascript.js +0 -163
  29. package/dist/rules/perfectionist.js +0 -73
  30. package/dist/rules/playwright.js +0 -27
  31. package/dist/rules/storybook.js +0 -15
  32. package/dist/rules/stylistic.js +0 -160
  33. package/dist/rules/tailwind.js +0 -36
  34. package/dist/rules/typescript.js +0 -62
  35. package/dist/rules/vitest.js +0 -46
  36. package/dist/rules/vue.js +0 -171
  37. package/dist/rules/vueAccessibility.js +0 -23
  38. package/dist/types/configOptions/base.d.ts +0 -47
  39. package/dist/types/configOptions/css.d.ts +0 -27
  40. package/dist/types/configOptions/html.d.ts +0 -27
  41. package/dist/types/configOptions/importX.d.ts +0 -29
  42. package/dist/types/configOptions/nuxt.d.ts +0 -42
  43. package/dist/types/configOptions/perfectionist.d.ts +0 -16
  44. package/dist/types/configOptions/stylistic.d.ts +0 -145
  45. package/dist/types/configOptions/tailwind.d.ts +0 -46
  46. package/dist/types/configOptions/test.d.ts +0 -55
  47. package/dist/types/configOptions/typescript.d.ts +0 -36
  48. package/dist/types/configOptions/vue.d.ts +0 -211
  49. package/dist/types/configOptions/vueAccessibility.d.ts +0 -34
  50. package/dist/types/eslint-schema.d.ts +0 -13732
  51. package/dist/types/eslintRules.d.ts +0 -12
  52. package/dist/types/helpers.d.ts +0 -5
  53. package/dist/types/index.d.ts +0 -360
  54. package/dist/utils/globs.js +0 -31
  55. package/dist/utils/ignores/defaultIgnorePatterns.js +0 -57
  56. package/dist/utils/ignores/getIgnorePatterns.js +0 -16
  57. package/dist/utils/ignores/resolveGitignorePatterns.js +0 -26
  58. package/dist/utils/isEmptyString.js +0 -7
  59. package/dist/utils/isEnabled.js +0 -7
  60. package/dist/utils/isPackageDetected.js +0 -20
  61. package/dist/utils/options/defaultOptions.js +0 -168
  62. package/dist/utils/options/enableDetectedConfigs.js +0 -40
  63. package/dist/utils/options/mergeWithDefaults.js +0 -21
  64. package/dist/utils/vue/getRestrictedVueElements.js +0 -27
  65. package/dist/utils/vue/getRestrictedVueInputs.js +0 -23
@@ -1,168 +0,0 @@
1
- //#region src/utils/options/defaultOptions.ts
2
- const defaultOptions = {
3
- autoDetectDeps: true,
4
- gitignore: ".gitignore",
5
- env: "node",
6
- packageDir: ".",
7
- tsConfig: false,
8
- global: {
9
- basePath: ".",
10
- ignores: [],
11
- linterOptions: {
12
- noInlineConfig: false,
13
- reportUnusedInlineConfigs: "warn",
14
- reportUnusedDisableDirectives: "warn"
15
- },
16
- globals: {
17
- node: true,
18
- commonjs: false,
19
- browser: true,
20
- worker: true,
21
- serviceworker: false,
22
- webextension: false,
23
- custom: {}
24
- },
25
- settings: {},
26
- rules: {}
27
- },
28
- configs: {
29
- oxlint: "./.oxlintrc.json",
30
- base: {
31
- maxDepth: 3,
32
- maxNestedCallbacks: 3,
33
- preferNamedExports: true,
34
- functionStyle: "declaration",
35
- overrides: {}
36
- },
37
- stylistic: {
38
- semi: "always",
39
- trailingComma: "always-multiline",
40
- memberDelimiterStyle: "comma",
41
- quotes: "single",
42
- jsxQuotes: "prefer-double",
43
- arrowParens: "always",
44
- useTabs: true,
45
- indent: 2,
46
- maxConsecutiveEmptyLines: 1,
47
- maxLineLength: 120,
48
- maxAttributesPerLine: 3,
49
- selfCloseVoidHTMLElements: "always",
50
- overrides: {}
51
- },
52
- html: {
53
- useBaseline: false,
54
- idNamingConvention: "snake_case",
55
- overrides: {}
56
- },
57
- css: {
58
- useBaseline: false,
59
- allowedRelativeFontUnits: ["rem", "em"],
60
- overrides: {}
61
- },
62
- tailwind: {
63
- multilineSort: true,
64
- ignoredUnregisteredClasses: [],
65
- config: "",
66
- entryPoint: "",
67
- overrides: {}
68
- },
69
- typescript: {
70
- allowedDefaultProjects: [],
71
- methodSignatureStyle: "method",
72
- typeDefinitionStyle: "interface",
73
- overrides: {}
74
- },
75
- importX: {
76
- removeUnusedImports: true,
77
- requireFileExtension: true,
78
- overrides: {}
79
- },
80
- perfectionist: {
81
- sortType: "line-length",
82
- overrides: {}
83
- },
84
- vue: {
85
- accessibility: {
86
- imageComponents: ["NuxtImg"],
87
- anchorComponents: [
88
- "RouterLink",
89
- "NuxtLink",
90
- "ULink"
91
- ],
92
- accessibleChildComponents: [
93
- "img",
94
- "picture",
95
- "NuxtImg",
96
- "NuxtPicture"
97
- ]
98
- },
99
- blocksOrder: [
100
- "script:not([setup])",
101
- "script[setup]",
102
- "template",
103
- "i18n[locale=en]",
104
- "i18n:not([locale=en])",
105
- "style:not([scoped])",
106
- "style[scoped]",
107
- "docs"
108
- ],
109
- macrosOrder: [
110
- "definePage",
111
- "defineOptions",
112
- "defineModel",
113
- "defineProps",
114
- "defineEmits",
115
- "defineSlots",
116
- "defineCustom",
117
- "defineExpose"
118
- ],
119
- attributesOrder: [
120
- "DEFINITION",
121
- "CONDITIONALS",
122
- "RENDER_MODIFIERS",
123
- "LIST_RENDERING",
124
- "UNIQUE",
125
- "GLOBAL",
126
- "TWO_WAY_BINDING",
127
- "SLOT",
128
- "CONTENT",
129
- "OTHER_DIRECTIVES",
130
- "EVENTS",
131
- "ATTR_SHORTHAND_BOOL",
132
- "ATTR_DYNAMIC",
133
- "ATTR_STATIC"
134
- ],
135
- attributeHyphenation: "never",
136
- preferVBindSameNameShorthand: "always",
137
- preferVBindTrueShorthand: "always",
138
- allowedStyleAttributes: ["scoped", "module"],
139
- blockLang: {
140
- script: "js",
141
- style: "implicit"
142
- },
143
- destructureProps: "always",
144
- componentNameCaseInTemplate: "PascalCase",
145
- vForDelimiterStyle: "in",
146
- vOnHandlerStyle: ["method", "inline-function"],
147
- restrictedElements: [],
148
- restrictedStaticAttributes: [],
149
- ignoredUndefinedComponents: [],
150
- overrides: {}
151
- },
152
- nuxt: {
153
- image: false,
154
- ui: { prefix: "U" }
155
- },
156
- test: {
157
- storybook: { overrides: {} },
158
- vitest: { overrides: {} },
159
- playwright: { overrides: {} },
160
- cypress: { overrides: {} },
161
- testFunction: "test",
162
- maxNestedDescribe: 1
163
- }
164
- }
165
- };
166
-
167
- //#endregion
168
- export { defaultOptions };
@@ -1,40 +0,0 @@
1
- import { defaultOptions } from "./defaultOptions.js";
2
- import { isPackageDetected, logDetectedPackages } from "../isPackageDetected.js";
3
-
4
- //#region src/utils/options/enableDetectedConfigs.ts
5
- function enableDetectedConfigs(options) {
6
- options.configs ??= {};
7
- options.configs.test ??= {};
8
- options.configs.html ??= false;
9
- options.configs.css ??= false;
10
- options.configs.tailwind ??= false;
11
- options.configs.importX ??= true;
12
- options.configs.stylistic ??= true;
13
- options.configs.perfectionist ??= true;
14
- options.configs.vue ??= isPackageDetected("vue", options);
15
- options.configs.nuxt ??= isPackageDetected("nuxt", options);
16
- options.configs.typescript ??= isPackageDetected("typescript", options);
17
- options.configs.test.vitest ??= isPackageDetected("vitest", options);
18
- options.configs.test.cypress ??= isPackageDetected("cypress", options);
19
- options.configs.test.storybook ??= isPackageDetected("storybook", options);
20
- options.configs.test.playwright ??= isPackageDetected("@playwright/test", options);
21
- options.configs.oxlint ??= isPackageDetected("oxlint", options) ? defaultOptions.configs.oxlint : false;
22
- options.tsConfig ??= options.configs.typescript ? {
23
- rootDir: ".",
24
- filename: "tsconfig.json"
25
- } : false;
26
- if (options.configs.typescript && options.configs.vue) {
27
- options.configs.vue = options.configs.vue === true ? {} : options.configs.vue;
28
- options.configs.vue.blockLang = { script: "ts" };
29
- }
30
- if (options.configs.nuxt) {
31
- if (options.configs.nuxt === true) options.configs.nuxt = {};
32
- options.configs.nuxt.ui ??= isPackageDetected("@nuxt/ui", options);
33
- options.configs.nuxt.image ??= isPackageDetected("@nuxt/image", options);
34
- }
35
- if (options.autoDetectDeps === "verbose") logDetectedPackages();
36
- return options;
37
- }
38
-
39
- //#endregion
40
- export { enableDetectedConfigs };
@@ -1,21 +0,0 @@
1
- import { defaultOptions } from "./defaultOptions.js";
2
- import { isEmptyString } from "../isEmptyString.js";
3
- import { enableDetectedConfigs } from "./enableDetectedConfigs.js";
4
- import { createDefu } from "defu";
5
-
6
- //#region src/utils/options/mergeWithDefaults.ts
7
- const mergeOptions = createDefu((object, key, value) => {
8
- const isValueTrue = value === true;
9
- const isDefaultValueFalse = object[key] === false;
10
- const isValueEmptyString = isEmptyString(value);
11
- const fallBackToDefault = isValueEmptyString || isValueTrue && !isDefaultValueFalse;
12
- return fallBackToDefault;
13
- });
14
- function mergeWithDefaults(options) {
15
- const optionsWithDetectedConfigs = enableDetectedConfigs(options);
16
- const mergedOptions = mergeOptions(optionsWithDetectedConfigs, defaultOptions);
17
- return mergedOptions;
18
- }
19
-
20
- //#endregion
21
- export { mergeWithDefaults };
@@ -1,27 +0,0 @@
1
- //#region src/utils/vue/getRestrictedVueElements.ts
2
- const alternativeComponents = {
3
- kbd: "Kbd",
4
- form: "Form",
5
- input: "Input",
6
- table: "Table",
7
- dialog: "Modal",
8
- hr: "Separator",
9
- button: "Button",
10
- select: "Select",
11
- progress: "Progress",
12
- textarea: "Textarea",
13
- details: "Accordion",
14
- datalist: "InputMenu"
15
- };
16
- const alternativeComponentPairs = Object.entries(alternativeComponents);
17
- function getRestrictedVueElements(prefix) {
18
- const restrictedElements = [];
19
- for (const [element, component] of alternativeComponentPairs) restrictedElements.push({
20
- element,
21
- message: `Use <${prefix}${component}>.`
22
- });
23
- return restrictedElements;
24
- }
25
-
26
- //#endregion
27
- export { getRestrictedVueElements };
@@ -1,23 +0,0 @@
1
- //#region src/utils/vue/getRestrictedVueInputs.ts
2
- const alternativeComponents = {
3
- range: "Slider",
4
- date: "Calendar",
5
- radio: "RadioGroup",
6
- checkbox: "Checkbox",
7
- color: "ColorPicker",
8
- number: "InputNumber"
9
- };
10
- const alternativeComponentPairs = Object.entries(alternativeComponents);
11
- function getRestrictedVueInputs(prefix) {
12
- const restrictedInputs = [];
13
- for (const [input, component] of alternativeComponentPairs) restrictedInputs.push({
14
- element: "input",
15
- key: "type",
16
- value: input,
17
- message: `Use <${prefix}${component}>.`
18
- });
19
- return restrictedInputs;
20
- }
21
-
22
- //#endregion
23
- export { getRestrictedVueInputs };