@shayanthenerd/eslint-config 0.28.5 → 0.29.1
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/README.md +10 -7
- package/dist/configs/unicorn.mjs +1 -1
- package/dist/helpers/options/defaultOptions.mjs +11 -2
- package/dist/rules/javascript.mjs +1 -6
- package/dist/rules/unicorn.mjs +266 -261
- package/dist/types/eslint-schema.d.mts +421 -356
- package/dist/types/eslintRules.d.mts +1 -3
- package/dist/types/index.d.mts +40 -3
- package/package.json +14 -14
- package/dist/types/options/base.d.mts +0 -35
package/README.md
CHANGED
|
@@ -18,7 +18,6 @@ ESLint configuration for enforcing best practices and maintaining a consistent c
|
|
|
18
18
|
- [Formatting](#formatting)
|
|
19
19
|
- [API Reference](#api-reference)
|
|
20
20
|
- [Versioning Policy](#versioning-policy)
|
|
21
|
-
- [Roadmap to v1.0.0](#roadmap-to-v100)
|
|
22
21
|
- [Contribution Guide](#contribution-guide)
|
|
23
22
|
- [Credits](#credits)
|
|
24
23
|
- [License](#license)
|
|
@@ -462,7 +461,6 @@ _.vscode/settings.json_:
|
|
|
462
461
|
overrides?: Overrides,
|
|
463
462
|
},
|
|
464
463
|
base?: {
|
|
465
|
-
functionStyle?: 'expression' | 'declaration',
|
|
466
464
|
maxDepth?: number,
|
|
467
465
|
maxNestedCallbacks?: number,
|
|
468
466
|
overrides?: Overrides,
|
|
@@ -570,6 +568,16 @@ _.vscode/settings.json_:
|
|
|
570
568
|
overrides?: Overrides,
|
|
571
569
|
},
|
|
572
570
|
unicorn?: boolean | {
|
|
571
|
+
functionStyle?: {
|
|
572
|
+
callbacks?: 'ignore' | 'arrow-function' | 'function-expression',
|
|
573
|
+
default?: 'ignore' | 'declaration' | 'arrow-function' | 'function-expression',
|
|
574
|
+
defaultExport?: 'ignore' | 'declaration' | 'arrow-function' | 'function-expression',
|
|
575
|
+
namedExports?: 'ignore' | 'declaration' | 'arrow-function' | 'function-expression',
|
|
576
|
+
namedFunctions?: 'ignore' | 'declaration' | 'arrow-function' | 'function-expression',
|
|
577
|
+
objectProperties?: 'ignore' | 'method' | 'arrow-function' | 'function-expression',
|
|
578
|
+
reassignedVariables?: 'ignore' | 'arrow-function' | 'function-expression',
|
|
579
|
+
typedVariables?: 'ignore' | 'arrow-function' | 'function-expression',
|
|
580
|
+
},
|
|
573
581
|
overrides?: Overrides,
|
|
574
582
|
},
|
|
575
583
|
useBaseline?: boolean | {
|
|
@@ -660,11 +668,6 @@ Under this policy, minor updates may introduce new linting errors, which could b
|
|
|
660
668
|
|
|
661
669
|
You can find a list of all available versions and their changelogs on the [releases page][releases].
|
|
662
670
|
|
|
663
|
-
## Roadmap to v1.0.0
|
|
664
|
-
- [x] Add integration for ESLint plugins such as [eslint-plugin-n][plugin-n], [eslint-plugin-unicorn][plugin-unicorn], and more.
|
|
665
|
-
- [x] Add support for React, Next, Astro, and Markdown.
|
|
666
|
-
- [ ] Develop an interactive starter wizard to quickly scaffold the configurations for ESLint, Prettier, etc.
|
|
667
|
-
|
|
668
671
|
## Contribution Guide
|
|
669
672
|
Contributions of all kinds are welcome. Please check out the [CONTRIBUTING.md][contributing] file.
|
|
670
673
|
|
package/dist/configs/unicorn.mjs
CHANGED
|
@@ -36,7 +36,6 @@ const defaultOptions = {
|
|
|
36
36
|
configs: {
|
|
37
37
|
astro: { overrides: {} },
|
|
38
38
|
base: {
|
|
39
|
-
functionStyle: "declaration",
|
|
40
39
|
maxDepth: 3,
|
|
41
40
|
maxNestedCallbacks: 3,
|
|
42
41
|
overrides: {}
|
|
@@ -130,7 +129,17 @@ const defaultOptions = {
|
|
|
130
129
|
typeDefinitionStyle: "interface",
|
|
131
130
|
overrides: {}
|
|
132
131
|
},
|
|
133
|
-
unicorn: {
|
|
132
|
+
unicorn: {
|
|
133
|
+
functionStyle: {
|
|
134
|
+
callbacks: "arrow-function",
|
|
135
|
+
defaultExport: "declaration",
|
|
136
|
+
namedExports: "declaration",
|
|
137
|
+
namedFunctions: "declaration",
|
|
138
|
+
reassignedVariables: "arrow-function",
|
|
139
|
+
typedVariables: "arrow-function"
|
|
140
|
+
},
|
|
141
|
+
overrides: {}
|
|
142
|
+
},
|
|
134
143
|
useBaseline: {
|
|
135
144
|
baseline: "widely",
|
|
136
145
|
css: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
2
2
|
//#region src/rules/javascript.ts
|
|
3
3
|
function getJavaScriptRules(options) {
|
|
4
|
-
const { unicorn, typescript, base: { maxDepth,
|
|
4
|
+
const { unicorn, typescript, base: { maxDepth, maxNestedCallbacks } } = options.configs;
|
|
5
5
|
const isUnicornEnabled = isEnabled(unicorn);
|
|
6
6
|
const isTypeScriptEnabled = isEnabled(typescript);
|
|
7
7
|
return {
|
|
@@ -89,11 +89,6 @@ function getJavaScriptRules(options) {
|
|
|
89
89
|
"eqeqeq": "error",
|
|
90
90
|
"func-name-matching": "warn",
|
|
91
91
|
"func-names": ["warn", "as-needed"],
|
|
92
|
-
"func-style": [
|
|
93
|
-
"warn",
|
|
94
|
-
functionStyle,
|
|
95
|
-
{ allowTypeAnnotation: true }
|
|
96
|
-
],
|
|
97
92
|
"guard-for-in": "warn",
|
|
98
93
|
"grouped-accessor-pairs": [
|
|
99
94
|
"warn",
|