@ghettoddos/eslint-config 1.0.0 → 1.0.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/dist/index.d.ts CHANGED
@@ -14,6 +14,61 @@ interface RuleOptions {
14
14
  * @see https://eslint.org/docs/latest/rules/accessor-pairs
15
15
  */
16
16
  'accessor-pairs'?: Linter.RuleEntry<AccessorPairs>
17
+ /**
18
+ * Having line breaks styles to object, array and named imports
19
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/consistent-chaining.md
20
+ */
21
+ 'antfu/consistent-chaining'?: Linter.RuleEntry<AntfuConsistentChaining>
22
+ /**
23
+ * Having line breaks styles to object, array and named imports
24
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/consistent-list-newline.md
25
+ */
26
+ 'antfu/consistent-list-newline'?: Linter.RuleEntry<AntfuConsistentListNewline>
27
+ /**
28
+ * Enforce Anthony's style of curly bracket
29
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/curly.md
30
+ */
31
+ 'antfu/curly'?: Linter.RuleEntry<[]>
32
+ /**
33
+ * Newline after if
34
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/if-newline.md
35
+ */
36
+ 'antfu/if-newline'?: Linter.RuleEntry<[]>
37
+ /**
38
+ * Fix duplication in imports
39
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/import-dedupe.md
40
+ */
41
+ 'antfu/import-dedupe'?: Linter.RuleEntry<[]>
42
+ /**
43
+ * Enforce consistent indentation in `unindent` template tag
44
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/indent-unindent.md
45
+ */
46
+ 'antfu/indent-unindent'?: Linter.RuleEntry<AntfuIndentUnindent>
47
+ /**
48
+ * Prevent importing modules in `dist` folder
49
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-import-dist.test.ts
50
+ */
51
+ 'antfu/no-import-dist'?: Linter.RuleEntry<[]>
52
+ /**
53
+ * Prevent importing modules in `node_modules` folder by relative or absolute path
54
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-import-node-modules-by-path.test.ts
55
+ */
56
+ 'antfu/no-import-node-modules-by-path'?: Linter.RuleEntry<[]>
57
+ /**
58
+ * Prevent using top-level await
59
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-top-level-await.test.ts
60
+ */
61
+ 'antfu/no-top-level-await'?: Linter.RuleEntry<[]>
62
+ /**
63
+ * Do not use `exports =`
64
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/no-ts-export-equal.test.ts
65
+ */
66
+ 'antfu/no-ts-export-equal'?: Linter.RuleEntry<[]>
67
+ /**
68
+ * Enforce top-level functions to be declared with function keyword
69
+ * @see https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/top-level-function.md
70
+ */
71
+ 'antfu/top-level-function'?: Linter.RuleEntry<[]>
17
72
  /**
18
73
  * Enforce linebreaks after opening and before closing array brackets
19
74
  * @see https://eslint.org/docs/latest/rules/array-bracket-newline
@@ -5314,6 +5369,39 @@ type AccessorPairs = []|[{
5314
5369
  setWithoutGet?: boolean
5315
5370
  enforceForClassMembers?: boolean
5316
5371
  }]
5372
+ // ----- antfu/consistent-chaining -----
5373
+ type AntfuConsistentChaining = []|[{
5374
+
5375
+ allowLeadingPropertyAccess?: boolean
5376
+ }]
5377
+ // ----- antfu/consistent-list-newline -----
5378
+ type AntfuConsistentListNewline = []|[{
5379
+ ArrayExpression?: boolean
5380
+ ArrayPattern?: boolean
5381
+ ArrowFunctionExpression?: boolean
5382
+ CallExpression?: boolean
5383
+ ExportNamedDeclaration?: boolean
5384
+ FunctionDeclaration?: boolean
5385
+ FunctionExpression?: boolean
5386
+ ImportDeclaration?: boolean
5387
+ JSONArrayExpression?: boolean
5388
+ JSONObjectExpression?: boolean
5389
+ JSXOpeningElement?: boolean
5390
+ NewExpression?: boolean
5391
+ ObjectExpression?: boolean
5392
+ ObjectPattern?: boolean
5393
+ TSFunctionType?: boolean
5394
+ TSInterfaceDeclaration?: boolean
5395
+ TSTupleType?: boolean
5396
+ TSTypeLiteral?: boolean
5397
+ TSTypeParameterDeclaration?: boolean
5398
+ TSTypeParameterInstantiation?: boolean
5399
+ }]
5400
+ // ----- antfu/indent-unindent -----
5401
+ type AntfuIndentUnindent = []|[{
5402
+ indent?: number
5403
+ tags?: string[]
5404
+ }]
5317
5405
  // ----- array-bracket-newline -----
5318
5406
  type ArrayBracketNewline = []|[(("always" | "never" | "consistent") | {
5319
5407
  multiline?: boolean
package/dist/index.js CHANGED
@@ -4,11 +4,12 @@ import { isPackageExists as isPackageExists3 } from "local-pkg";
4
4
 
5
5
  // src/plugins.ts
6
6
  import { default as default2 } from "@eslint-community/eslint-plugin-eslint-comments";
7
+ import { default as default3 } from "eslint-plugin-antfu";
7
8
  import * as pluginImport from "eslint-plugin-import-x";
8
- import { default as default3 } from "eslint-plugin-n";
9
- import { default as default4 } from "eslint-plugin-perfectionist";
10
- import { default as default5 } from "eslint-plugin-unicorn";
11
- import { default as default6 } from "eslint-plugin-unused-imports";
9
+ import { default as default4 } from "eslint-plugin-n";
10
+ import { default as default5 } from "eslint-plugin-perfectionist";
11
+ import { default as default6 } from "eslint-plugin-unicorn";
12
+ import { default as default7 } from "eslint-plugin-unused-imports";
12
13
 
13
14
  // src/configs/comments.ts
14
15
  async function comments() {
@@ -241,11 +242,16 @@ async function stylistic(options = {}) {
241
242
  {
242
243
  name: "stylistic/rules",
243
244
  plugins: {
245
+ antfu: default3,
244
246
  style: pluginStylistic
245
247
  },
246
248
  rules: {
247
249
  ...config2.rules,
248
- "curly": ["error", "all"],
250
+ "antfu/consistent-chaining": "error",
251
+ "antfu/consistent-list-newline": "error",
252
+ "antfu/curly": "error",
253
+ "antfu/if-newline": "error",
254
+ "antfu/top-level-function": "error",
249
255
  "style/generator-star-spacing": [
250
256
  "error",
251
257
  { after: true, before: false }
@@ -442,9 +448,13 @@ async function imports(options = {}) {
442
448
  {
443
449
  name: "imports/rules",
444
450
  plugins: {
451
+ antfu: default3,
445
452
  import: pluginImport
446
453
  },
447
454
  rules: {
455
+ "antfu/import-dedupe": "error",
456
+ "antfu/no-import-dist": "error",
457
+ "antfu/no-import-node-modules-by-path": "error",
448
458
  "import/consistent-type-specifier-style": ["error", "prefer-top-level"],
449
459
  "import/first": "error",
450
460
  "import/no-duplicates": "error",
@@ -493,13 +503,15 @@ async function javascript(options = {}) {
493
503
  {
494
504
  name: "javascript/rules",
495
505
  plugins: {
496
- "unused-imports": default6
506
+ "antfu": default3,
507
+ "unused-imports": default7
497
508
  },
498
509
  rules: {
499
510
  "accessor-pairs": [
500
511
  "error",
501
512
  { enforceForClassMembers: true, setWithoutGet: true }
502
513
  ],
514
+ "antfu/no-top-level-await": "error",
503
515
  "array-callback-return": "error",
504
516
  "block-scoped-var": "error",
505
517
  "constructor-super": "error",
@@ -875,7 +887,7 @@ async function node() {
875
887
  {
876
888
  name: "node/rules",
877
889
  plugins: {
878
- node: default3
890
+ node: default4
879
891
  },
880
892
  rules: {
881
893
  "node/handle-callback-err": ["error", "^(err|error)$"],
@@ -897,7 +909,7 @@ async function perfectionist() {
897
909
  {
898
910
  name: "perfectionist/setup",
899
911
  plugins: {
900
- perfectionist: default4
912
+ perfectionist: default5
901
913
  },
902
914
  rules: {
903
915
  "perfectionist/sort-exports": [
@@ -1478,6 +1490,7 @@ async function typescript(options = {}) {
1478
1490
  // Install the plugins without globs, so they can be configured separately.
1479
1491
  name: "typescript/setup",
1480
1492
  plugins: {
1493
+ antfu: default3,
1481
1494
  ts: pluginTs
1482
1495
  }
1483
1496
  },
@@ -1576,10 +1589,10 @@ async function unicorn(options = {}) {
1576
1589
  {
1577
1590
  name: "unicorn/rules",
1578
1591
  plugins: {
1579
- unicorn: default5
1592
+ unicorn: default6
1580
1593
  },
1581
1594
  rules: {
1582
- ...options.allRecommended ? default5.configs.recommended.rules : {
1595
+ ...options.allRecommended ? default6.configs.recommended.rules : {
1583
1596
  "unicorn/consistent-empty-array-spread": "error",
1584
1597
  "unicorn/error-message": "error",
1585
1598
  "unicorn/escape-case": "error",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ghettoddos/eslint-config",
3
3
  "type": "module",
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "description": "ghettoDdOS ESLint config",
6
6
  "author": "ghettoDdOS <pen.egor2002@gamil.com> (https://github.com/ghettoDdOS/)",
7
7
  "license": "MIT",
@@ -46,6 +46,7 @@
46
46
  "eslint-config-flat-gitignore": "^2.1.0",
47
47
  "eslint-flat-config-utils": "^2.0.1",
48
48
  "eslint-merge-processors": "^2.0.0",
49
+ "eslint-plugin-antfu": "^3.1.1",
49
50
  "eslint-plugin-import-x": "^4.6.1",
50
51
  "eslint-plugin-jsonc": "^2.19.1",
51
52
  "eslint-plugin-n": "^17.16.2",