eslint-config-webpack 4.1.0 → 4.1.2

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.
@@ -1164,6 +1164,7 @@ function getConfig(esVersion) {
1164
1164
  ...javascriptConfig.configs.recommended,
1165
1165
  name: `javascript/es${esVersion}`,
1166
1166
  files: [`**/*.{${allExtensions.map((item) => item.slice(1)).join(",")}}`],
1167
+ ignores: ["**/*.d.ts"],
1167
1168
  settings: {
1168
1169
  "import/extensions": allExtensions,
1169
1170
  "import/ignore": [
@@ -11,10 +11,6 @@ async function getMarkdownRecommendedConfig() {
11
11
  // Nothing
12
12
  }
13
13
 
14
- if (!markdownPlugin) {
15
- return [];
16
- }
17
-
18
14
  return [
19
15
  {
20
16
  name: "markdown/code-blocks",
package/configs/node.js CHANGED
@@ -117,6 +117,8 @@ const commonRules = {
117
117
 
118
118
  let nodePlugin;
119
119
 
120
+ const ignores = ["**/*.d.ts"];
121
+
120
122
  /**
121
123
  * @returns {Promise<Record<string, string>>} config
122
124
  */
@@ -136,6 +138,7 @@ async function getCommonJSConfig() {
136
138
  return {
137
139
  ...nodeConfig,
138
140
  name: "node/commonjs",
141
+ ignores,
139
142
  plugins: {
140
143
  ...nodeConfig.plugins,
141
144
  import: importPlugin,
@@ -182,6 +185,7 @@ async function getModuleConfig() {
182
185
  return {
183
186
  ...nodeConfig,
184
187
  name: "node/module",
188
+ ignores,
185
189
  plugins: {
186
190
  ...nodeConfig.plugins,
187
191
  import: importPlugin,
@@ -221,6 +225,7 @@ async function getDirtyConfig() {
221
225
  n: nodePlugin,
222
226
  import: importPlugin,
223
227
  },
228
+ ignores: [...new Set([...commonjsConfig.ignores, ...moduleConfig.ignores])],
224
229
  languageOptions: {
225
230
  sourceType: "module",
226
231
  parserOptions: {
@@ -287,7 +287,14 @@ async function getTypescriptRecommendedConfig() {
287
287
  // Nothing
288
288
  }
289
289
 
290
- const { configs } = typescriptPlugin;
290
+ const { configs } = typescriptPlugin || {
291
+ configs: {
292
+ base: { languageOptions: {} },
293
+ eslintRecommended: {},
294
+ recommended: [{ name: "typescript-eslint/recommended", rules: {} }],
295
+ stylistic: [{ name: "typescript-eslint/stylistic", rules: {} }],
296
+ },
297
+ };
291
298
  const baseConfig = configs.base;
292
299
  const eslintRecommendedConfig = configs.eslintRecommended;
293
300
  const recommendedConfig = configs.recommended.find(
@@ -303,6 +310,7 @@ async function getTypescriptRecommendedConfig() {
303
310
  files: [
304
311
  `**/*.{${typescriptExtensions.map((item) => item.slice(1)).join(",")}}`,
305
312
  ],
313
+ ignores: ["**/*.d.ts"],
306
314
  languageOptions: {
307
315
  parser: baseConfig.languageOptions.parser,
308
316
  },
package/configs.js CHANGED
@@ -139,6 +139,7 @@ function getJavascriptConfig() {
139
139
  const minVersion = semver.minVersion(packageJson.engines.node).major;
140
140
 
141
141
  // https://node.green/
142
+ // https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping
142
143
  switch (minVersion) {
143
144
  case 6: {
144
145
  const config = { ...configs["javascript/es2016"] };
@@ -229,6 +230,17 @@ function getTypescriptConfig() {
229
230
  }
230
231
 
231
232
  const tsconfigJson = getJsonFile("tsconfig.json");
233
+
234
+ const isNoEmitEnabled =
235
+ (tsconfigJson &&
236
+ tsconfigJson.compilerOptions &&
237
+ tsconfigJson.compilerOptions.noEmit) ||
238
+ false;
239
+
240
+ if (isNoEmitEnabled) {
241
+ return {};
242
+ }
243
+
232
244
  const isStrict =
233
245
  (tsconfigJson &&
234
246
  tsconfigJson.compilerOptions &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-webpack",
3
- "version": "4.1.0",
3
+ "version": "4.1.2",
4
4
  "author": "Joshua Wiens (https://twitter.com/@d3viant0ne)",
5
5
  "license": "MIT",
6
6
  "description": "Provides Webpack's eslint rules as an extensible shared config",