@shayanthenerd/eslint-config 0.1.0 → 0.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.
Files changed (79) hide show
  1. package/README.md +25 -9
  2. package/dist/configs/base.js +1 -1
  3. package/dist/configs/commons.js +3 -2
  4. package/dist/configs/importX.js +22 -2
  5. package/dist/configs/oxlintOverrides.js +3 -1
  6. package/dist/configs/tailwind.js +3 -3
  7. package/dist/configs/typescript.js +1 -1
  8. package/dist/prettier.config.d.ts +6 -0
  9. package/dist/prettier.config.js +22 -26
  10. package/dist/rules/importX.js +12 -12
  11. package/dist/rules/vue.js +4 -2
  12. package/dist/types/configOptions/importX.d.ts +16 -7
  13. package/dist/types/eslint-schema.d.ts +475 -1
  14. package/dist/utils/globs.js +3 -2
  15. package/dist/utils/options/defaultOptions.js +2 -1
  16. package/dist/utils/options/enableDetectedConfigs.js +8 -4
  17. package/package.json +30 -37
  18. package/dist/_virtual/rolldown_runtime.cjs +0 -30
  19. package/dist/configs/base.cjs +0 -44
  20. package/dist/configs/commons.cjs +0 -26
  21. package/dist/configs/css.cjs +0 -29
  22. package/dist/configs/cypress.cjs +0 -23
  23. package/dist/configs/html.cjs +0 -23
  24. package/dist/configs/importX.cjs +0 -26
  25. package/dist/configs/nuxtMultiRootTemplate.cjs +0 -14
  26. package/dist/configs/oxlintOverrides.cjs +0 -49
  27. package/dist/configs/perfectionist.cjs +0 -24
  28. package/dist/configs/playwright.cjs +0 -23
  29. package/dist/configs/storybook.cjs +0 -24
  30. package/dist/configs/stylistic.cjs +0 -23
  31. package/dist/configs/tailwind.cjs +0 -43
  32. package/dist/configs/typescript.cjs +0 -31
  33. package/dist/configs/vitest.cjs +0 -23
  34. package/dist/configs/vue.cjs +0 -35
  35. package/dist/configs/vueComponentNames.cjs +0 -19
  36. package/dist/index.cjs +0 -55
  37. package/dist/index.d.cts +0 -16
  38. package/dist/rules/css.cjs +0 -65
  39. package/dist/rules/cypress.cjs +0 -16
  40. package/dist/rules/html.cjs +0 -53
  41. package/dist/rules/importX.cjs +0 -51
  42. package/dist/rules/javascript.cjs +0 -164
  43. package/dist/rules/perfectionist.cjs +0 -73
  44. package/dist/rules/playwright.cjs +0 -28
  45. package/dist/rules/storybook.cjs +0 -16
  46. package/dist/rules/stylistic.cjs +0 -160
  47. package/dist/rules/tailwind.cjs +0 -36
  48. package/dist/rules/typescript.cjs +0 -62
  49. package/dist/rules/vitest.cjs +0 -47
  50. package/dist/rules/vue.cjs +0 -169
  51. package/dist/rules/vueAccessibility.cjs +0 -23
  52. package/dist/types/configOptions/base.d.cts +0 -47
  53. package/dist/types/configOptions/css.d.cts +0 -27
  54. package/dist/types/configOptions/html.d.cts +0 -27
  55. package/dist/types/configOptions/importX.d.cts +0 -20
  56. package/dist/types/configOptions/nuxt.d.cts +0 -42
  57. package/dist/types/configOptions/perfectionist.d.cts +0 -16
  58. package/dist/types/configOptions/stylistic.d.cts +0 -145
  59. package/dist/types/configOptions/tailwind.d.cts +0 -46
  60. package/dist/types/configOptions/test.d.cts +0 -55
  61. package/dist/types/configOptions/typescript.d.cts +0 -36
  62. package/dist/types/configOptions/vue.d.cts +0 -211
  63. package/dist/types/configOptions/vueAccessibility.d.cts +0 -34
  64. package/dist/types/eslint-schema.d.cts +0 -13258
  65. package/dist/types/eslintRules.d.cts +0 -12
  66. package/dist/types/helpers.d.cts +0 -5
  67. package/dist/types/index.d.cts +0 -360
  68. package/dist/utils/globs.cjs +0 -31
  69. package/dist/utils/ignores/defaultIgnorePatterns.cjs +0 -58
  70. package/dist/utils/ignores/getIgnorePatterns.cjs +0 -16
  71. package/dist/utils/ignores/resolveGitignorePatterns.cjs +0 -27
  72. package/dist/utils/isEmptyString.cjs +0 -8
  73. package/dist/utils/isEnabled.cjs +0 -8
  74. package/dist/utils/isPackageDetected.cjs +0 -22
  75. package/dist/utils/options/defaultOptions.cjs +0 -168
  76. package/dist/utils/options/enableDetectedConfigs.cjs +0 -36
  77. package/dist/utils/options/mergeWithDefaults.cjs +0 -22
  78. package/dist/utils/vue/getRestrictedVueElements.cjs +0 -28
  79. package/dist/utils/vue/getRestrictedVueInputs.cjs +0 -24
@@ -1,168 +0,0 @@
1
-
2
- //#region src/utils/options/defaultOptions.ts
3
- const defaultOptions = {
4
- autoDetectDeps: true,
5
- gitignore: ".gitignore",
6
- env: "node",
7
- packageDir: ".",
8
- tsConfig: false,
9
- global: {
10
- basePath: ".",
11
- ignores: [],
12
- linterOptions: {
13
- noInlineConfig: false,
14
- reportUnusedInlineConfigs: "warn",
15
- reportUnusedDisableDirectives: "warn"
16
- },
17
- globals: {
18
- node: true,
19
- commonjs: false,
20
- browser: true,
21
- worker: true,
22
- serviceworker: false,
23
- webextension: false,
24
- custom: {}
25
- },
26
- settings: {},
27
- rules: {}
28
- },
29
- configs: {
30
- oxlint: "./.oxlintrc.json",
31
- base: {
32
- maxDepth: 3,
33
- maxNestedCallbacks: 3,
34
- preferNamedExports: true,
35
- functionStyle: "declaration",
36
- overrides: {}
37
- },
38
- stylistic: {
39
- semi: "always",
40
- trailingComma: "always-multiline",
41
- memberDelimiterStyle: "comma",
42
- quotes: "single",
43
- jsxQuotes: "prefer-double",
44
- arrowParens: "always",
45
- useTabs: true,
46
- indent: 2,
47
- maxConsecutiveEmptyLines: 1,
48
- maxLineLength: 120,
49
- maxAttributesPerLine: 3,
50
- selfCloseVoidHTMLElements: "always",
51
- overrides: {}
52
- },
53
- html: {
54
- useBaseline: false,
55
- idNamingConvention: "snake_case",
56
- overrides: {}
57
- },
58
- css: {
59
- useBaseline: false,
60
- allowedRelativeFontUnits: ["rem", "em"],
61
- overrides: {}
62
- },
63
- tailwind: {
64
- multilineSort: true,
65
- ignoredUnregisteredClasses: [],
66
- config: "",
67
- entryPoint: "",
68
- overrides: {}
69
- },
70
- typescript: {
71
- allowedDefaultProjects: [],
72
- methodSignatureStyle: "method",
73
- typeDefinitionStyle: "interface",
74
- overrides: {}
75
- },
76
- importX: {
77
- requireFileExtension: "always",
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
- exports.defaultOptions = defaultOptions;
@@ -1,36 +0,0 @@
1
- const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions = require('./defaultOptions.cjs');
2
- const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected = require('../isPackageDetected.cjs');
3
-
4
- //#region src/utils/options/enableDetectedConfigs.ts
5
- function enableDetectedConfigs(options) {
6
- options.configs ??= {};
7
- options.configs.test ??= {};
8
- options.tsConfig ??= options.configs.typescript ? {
9
- rootDir: ".",
10
- filename: "tsconfig.json"
11
- } : false;
12
- options.configs.html ??= false;
13
- options.configs.css ??= false;
14
- options.configs.tailwind ??= false;
15
- options.configs.importX ??= true;
16
- options.configs.stylistic ??= true;
17
- options.configs.perfectionist ??= true;
18
- options.configs.vue ??= require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.isPackageDetected("vue", options);
19
- options.configs.nuxt ??= require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.isPackageDetected("nuxt", options);
20
- options.configs.typescript ??= require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.isPackageDetected("typescript", options);
21
- options.configs.test.vitest ??= require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.isPackageDetected("vitest", options);
22
- options.configs.test.cypress ??= require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.isPackageDetected("cypress", options);
23
- options.configs.test.storybook ??= require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.isPackageDetected("storybook", options);
24
- options.configs.test.playwright ??= require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.isPackageDetected("@playwright/test", options);
25
- options.configs.oxlint ??= require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.isPackageDetected("oxlint", options) ? require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions.defaultOptions.configs.oxlint : false;
26
- if (options.configs.nuxt) {
27
- if (options.configs.nuxt === true) options.configs.nuxt = {};
28
- options.configs.nuxt.ui ??= require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.isPackageDetected("@nuxt/ui", options);
29
- options.configs.nuxt.image ??= require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.isPackageDetected("@nuxt/image", options);
30
- }
31
- if (options.autoDetectDeps === "verbose") require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isPackageDetected.logDetectedPackages();
32
- return options;
33
- }
34
-
35
- //#endregion
36
- exports.enableDetectedConfigs = enableDetectedConfigs;
@@ -1,22 +0,0 @@
1
- const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
- const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions = require('./defaultOptions.cjs');
3
- const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEmptyString = require('../isEmptyString.cjs');
4
- const require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_enableDetectedConfigs = require('./enableDetectedConfigs.cjs');
5
- const defu = require_rolldown_runtime.__toESM(require("defu"));
6
-
7
- //#region src/utils/options/mergeWithDefaults.ts
8
- const mergeOptions = (0, defu.createDefu)((object, key, value) => {
9
- const isValueTrue = value === true;
10
- const isDefaultValueFalse = object[key] === false;
11
- const isValueEmptyString = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_isEmptyString.isEmptyString(value);
12
- const fallBackToDefault = isValueEmptyString || isValueTrue && !isDefaultValueFalse;
13
- return fallBackToDefault;
14
- });
15
- function mergeWithDefaults(options) {
16
- const optionsWithDetectedConfigs = require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_enableDetectedConfigs.enableDetectedConfigs(options);
17
- const mergedOptions = mergeOptions(optionsWithDetectedConfigs, require__Users_shayan_Desktop_Dev_GitHub_eslint_config_src_utils_options_defaultOptions.defaultOptions);
18
- return mergedOptions;
19
- }
20
-
21
- //#endregion
22
- exports.mergeWithDefaults = mergeWithDefaults;
@@ -1,28 +0,0 @@
1
-
2
- //#region src/utils/vue/getRestrictedVueElements.ts
3
- const alternativeComponents = {
4
- kbd: "Kbd",
5
- form: "Form",
6
- input: "Input",
7
- table: "Table",
8
- dialog: "Modal",
9
- hr: "Separator",
10
- button: "Button",
11
- select: "Select",
12
- progress: "Progress",
13
- textarea: "Textarea",
14
- details: "Accordion",
15
- datalist: "InputMenu"
16
- };
17
- const alternativeComponentPairs = Object.entries(alternativeComponents);
18
- function getRestrictedVueElements(prefix) {
19
- const restrictedElements = [];
20
- for (const [element, component] of alternativeComponentPairs) restrictedElements.push({
21
- element,
22
- message: `Use <${prefix}${component}>.`
23
- });
24
- return restrictedElements;
25
- }
26
-
27
- //#endregion
28
- exports.getRestrictedVueElements = getRestrictedVueElements;
@@ -1,24 +0,0 @@
1
-
2
- //#region src/utils/vue/getRestrictedVueInputs.ts
3
- const alternativeComponents = {
4
- range: "Slider",
5
- date: "Calendar",
6
- radio: "RadioGroup",
7
- checkbox: "Checkbox",
8
- color: "ColorPicker",
9
- number: "InputNumber"
10
- };
11
- const alternativeComponentPairs = Object.entries(alternativeComponents);
12
- function getRestrictedVueInputs(prefix) {
13
- const restrictedInputs = [];
14
- for (const [input, component] of alternativeComponentPairs) restrictedInputs.push({
15
- element: "input",
16
- key: "type",
17
- value: input,
18
- message: `Use <${prefix}${component}>.`
19
- });
20
- return restrictedInputs;
21
- }
22
-
23
- //#endregion
24
- exports.getRestrictedVueInputs = getRestrictedVueInputs;