@meteorlxy/eslint-config 2.11.0 → 2.15.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 (2) hide show
  1. package/lib/index.js +39 -9
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -15,18 +15,29 @@ module.exports = {
15
15
  // Rules overrides
16
16
  rules: {
17
17
  /**
18
- * Override airbnb-base rules to allow for-of
18
+ * Disable checking for-in loops guard
19
+ *
20
+ * @see https://eslint.org/docs/rules/guard-for-in
21
+ * @see https://github.com/airbnb/javascript/blob/366bfa66380c08304101c6add46355696e90b348/packages/eslint-config-airbnb-base/rules/best-practices.js#L60-L62
22
+ */
23
+ 'guard-for-in': 'off',
24
+
25
+ /**
26
+ * Allow await in loop
27
+ *
28
+ * @see https://eslint.org/docs/rules/no-await-in-loop
29
+ * @see https://github.com/airbnb/javascript/blob/366bfa66380c08304101c6add46355696e90b348/packages/eslint-config-airbnb-base/rules/errors.js#L15-L17
30
+ */
31
+ 'no-await-in-loop': 'off',
32
+
33
+ /**
34
+ * Override airbnb-base rules to allow for-of and for-in
19
35
  *
20
36
  * @see https://eslint.org/docs/rules/no-restricted-syntax
21
- * @see https://github.com/airbnb/javascript/blob/1ca21aba799699ba556bed058e3900514a9fbee3/packages/eslint-config-airbnb-base/rules/style.js#L336-L339
37
+ * @see https://github.com/airbnb/javascript/blob/366bfa66380c08304101c6add46355696e90b348/packages/eslint-config-airbnb-base/rules/style.js#L334-L354
22
38
  */
23
39
  'no-restricted-syntax': [
24
40
  'error',
25
- {
26
- selector: 'ForInStatement',
27
- message:
28
- 'for..in loops iterate over the entire prototype chain, which is virtually never what you want.',
29
- },
30
41
  {
31
42
  selector: 'LabeledStatement',
32
43
  message:
@@ -69,8 +80,26 @@ module.exports = {
69
80
  },
70
81
  ],
71
82
 
72
- // Add config files of some other tools
73
- // @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md
83
+ /**
84
+ * Override airbnb-base rules to enforce .mjs extension
85
+ *
86
+ * @see https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/extensions.md
87
+ * @see https://github.com/airbnb/javascript/blob/1ca21aba799699ba556bed058e3900514a9fbee3/packages/eslint-config-airbnb-base/rules/imports.js#L138-L142
88
+ */
89
+ 'import/extensions': [
90
+ airbnbRulesImports.rules['import/extensions'][0],
91
+ airbnbRulesImports.rules['import/extensions'][1],
92
+ {
93
+ ...airbnbRulesImports.rules['import/extensions'][2],
94
+ mjs: 'always',
95
+ },
96
+ ],
97
+
98
+ /**
99
+ * Add config files of some other tools
100
+ *
101
+ * @see https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md
102
+ */
74
103
  'import/no-extraneous-dependencies': [
75
104
  airbnbRulesImports.rules['import/no-extraneous-dependencies'][0],
76
105
  {
@@ -80,6 +109,7 @@ module.exports = {
80
109
  .devDependencies,
81
110
  '**/.vitepress/*.js',
82
111
  '**/.vuepress/*.js',
112
+ '**/build.config.js',
83
113
  '**/tsup.config.js',
84
114
  '**/vite.config.js',
85
115
  '**/vitest.config.js',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meteorlxy/eslint-config",
3
- "version": "2.11.0",
3
+ "version": "2.15.0",
4
4
  "description": "meteorlxy eslint config",
5
5
  "keywords": [
6
6
  "config",
@@ -25,5 +25,5 @@
25
25
  "publishConfig": {
26
26
  "access": "public"
27
27
  },
28
- "gitHead": "f5cb476a66acf2856eb5c303bd6c7dacd71c60f1"
28
+ "gitHead": "e7ee200ac611bfe5b39e5e52e292b0d46b90e9da"
29
29
  }