@shayanthenerd/eslint-config 0.28.4 → 0.29.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/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
 
@@ -18,7 +18,7 @@ function getUnicornConfig(options) {
18
18
  isEnabled(astro) ? globs.astro : ""
19
19
  ].filter(isTruthy),
20
20
  plugins: { unicorn: eslintPluginUnicorn },
21
- rules: getUnicornRules()
21
+ rules: getUnicornRules(options)
22
22
  }, overrides);
23
23
  }
24
24
  //#endregion
@@ -9,6 +9,7 @@ const defaultIgnorePatterns = [
9
9
  "**/next-env.d.ts",
10
10
  "**/components.d.ts",
11
11
  "**/routeTree.gen.ts",
12
+ "**/eslint-typegen.d.ts",
12
13
  "**/auto-import?(s).d.ts",
13
14
  "**/out",
14
15
  "**/dist",
@@ -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,19 @@ const defaultOptions = {
130
129
  typeDefinitionStyle: "interface",
131
130
  overrides: {}
132
131
  },
133
- unicorn: { overrides: {} },
132
+ unicorn: {
133
+ functionStyle: {
134
+ callbacks: "arrow-function",
135
+ default: "declaration",
136
+ defaultExport: "declaration",
137
+ namedExports: "declaration",
138
+ namedFunctions: "declaration",
139
+ objectProperties: "method",
140
+ reassignedVariables: "arrow-function",
141
+ typedVariables: "arrow-function"
142
+ },
143
+ overrides: {}
144
+ },
134
145
  useBaseline: {
135
146
  baseline: "widely",
136
147
  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, functionStyle, maxNestedCallbacks } } = options.configs;
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",
@@ -22,6 +22,7 @@ function getPlaywrightRules(options) {
22
22
  "playwright/no-skipped-test": "error",
23
23
  "playwright/no-slowed-test": "warn",
24
24
  "playwright/no-standalone-expect": "error",
25
+ "playwright/no-unnecessary-assertions": "error",
25
26
  "playwright/no-unsafe-references": "error",
26
27
  "playwright/no-unused-locators": "warn",
27
28
  "playwright/no-useless-await": "warn",