@szum-tech/eslint-config 2.1.1 → 2.1.3

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.cjs CHANGED
@@ -16,7 +16,25 @@ var vitestPlugin = require('@vitest/eslint-plugin');
16
16
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
17
17
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
18
18
 
19
- var importPlugin__default = /*#__PURE__*/_interopDefault(importPlugin);
19
+ function _interopNamespace(e) {
20
+ if (e && e.__esModule) return e;
21
+ var n = Object.create(null);
22
+ if (e) {
23
+ Object.keys(e).forEach(function (k) {
24
+ if (k !== 'default') {
25
+ var d = Object.getOwnPropertyDescriptor(e, k);
26
+ Object.defineProperty(n, k, d.get ? d : {
27
+ enumerable: true,
28
+ get: function () { return e[k]; }
29
+ });
30
+ }
31
+ });
32
+ }
33
+ n.default = e;
34
+ return Object.freeze(n);
35
+ }
36
+
37
+ var importPlugin__namespace = /*#__PURE__*/_interopNamespace(importPlugin);
20
38
  var jestDomPlugin__default = /*#__PURE__*/_interopDefault(jestDomPlugin);
21
39
  var playwrightPlugin__default = /*#__PURE__*/_interopDefault(playwrightPlugin);
22
40
  var reactPlugin__default = /*#__PURE__*/_interopDefault(reactPlugin);
@@ -50,6 +68,8 @@ var hasJestDom = has("@testing-library/jest-dom");
50
68
  var hasVitest = has("vitest");
51
69
  var hasPlaywright = has("@playwright/test");
52
70
  var hasStorybook = has("storybook");
71
+ var typeScriptExtensions = [".ts", ".cts", ".mts", ".tsx"];
72
+ var allExtensions = [...typeScriptExtensions, ".js", ".jsx", ".mjs", ".cjs"];
53
73
  var vitestFiles = ["**/__tests__/**/*", "**/*.test.*"];
54
74
  var testFiles = ["**/tests/**", ...vitestFiles];
55
75
  var playwrightFiles = ["**/e2e/**", "**/*.e2e.*"];
@@ -70,7 +90,7 @@ var config = [
70
90
  {
71
91
  name: "eslint/config/base&import",
72
92
  plugins: {
73
- import: importPlugin__default.default
93
+ import: importPlugin__namespace
74
94
  },
75
95
  languageOptions: {
76
96
  ecmaVersion: "latest",
@@ -83,14 +103,6 @@ var config = [
83
103
  warnOnUnsupportedTypeScriptVersion: false
84
104
  }
85
105
  },
86
- settings: {
87
- "import/resolver": {
88
- // You will also need to install and configure the TypeScript resolver
89
- // See also https://github.com/import-js/eslint-import-resolver-typescript#configuration
90
- typescript: hasTypeScript,
91
- node: true
92
- }
93
- },
94
106
  rules: {
95
107
  "no-unexpected-multiline": ERROR,
96
108
  "no-warning-comments": [ERROR, { terms: ["FIXME"], location: "anywhere" }],
@@ -246,6 +258,18 @@ var config = [
246
258
  plugins: {
247
259
  "@typescript-eslint": tsEslint__default.default.plugin
248
260
  },
261
+ settings: {
262
+ "import/extensions": allExtensions,
263
+ "import/external-module-folders": ["node_modules", "node_modules/@types"],
264
+ "import/parsers": {
265
+ "@typescript-eslint/parser": typeScriptExtensions
266
+ },
267
+ "import/resolver": {
268
+ node: {
269
+ extensions: allExtensions
270
+ }
271
+ }
272
+ },
249
273
  rules: {
250
274
  "no-unused-expressions": OFF,
251
275
  "no-array-constructor": OFF,
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import importPlugin from 'eslint-plugin-import';
1
+ import * as importPlugin from 'eslint-plugin-import';
2
2
  import jestDomPlugin from 'eslint-plugin-jest-dom';
3
3
  import playwrightPlugin from 'eslint-plugin-playwright';
4
4
  import reactPlugin from 'eslint-plugin-react';
@@ -32,6 +32,8 @@ var hasJestDom = has("@testing-library/jest-dom");
32
32
  var hasVitest = has("vitest");
33
33
  var hasPlaywright = has("@playwright/test");
34
34
  var hasStorybook = has("storybook");
35
+ var typeScriptExtensions = [".ts", ".cts", ".mts", ".tsx"];
36
+ var allExtensions = [...typeScriptExtensions, ".js", ".jsx", ".mjs", ".cjs"];
35
37
  var vitestFiles = ["**/__tests__/**/*", "**/*.test.*"];
36
38
  var testFiles = ["**/tests/**", ...vitestFiles];
37
39
  var playwrightFiles = ["**/e2e/**", "**/*.e2e.*"];
@@ -65,14 +67,6 @@ var config = [
65
67
  warnOnUnsupportedTypeScriptVersion: false
66
68
  }
67
69
  },
68
- settings: {
69
- "import/resolver": {
70
- // You will also need to install and configure the TypeScript resolver
71
- // See also https://github.com/import-js/eslint-import-resolver-typescript#configuration
72
- typescript: hasTypeScript,
73
- node: true
74
- }
75
- },
76
70
  rules: {
77
71
  "no-unexpected-multiline": ERROR,
78
72
  "no-warning-comments": [ERROR, { terms: ["FIXME"], location: "anywhere" }],
@@ -228,6 +222,18 @@ var config = [
228
222
  plugins: {
229
223
  "@typescript-eslint": tsEslint.plugin
230
224
  },
225
+ settings: {
226
+ "import/extensions": allExtensions,
227
+ "import/external-module-folders": ["node_modules", "node_modules/@types"],
228
+ "import/parsers": {
229
+ "@typescript-eslint/parser": typeScriptExtensions
230
+ },
231
+ "import/resolver": {
232
+ node: {
233
+ extensions: allExtensions
234
+ }
235
+ }
236
+ },
231
237
  rules: {
232
238
  "no-unused-expressions": OFF,
233
239
  "no-array-constructor": OFF,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@szum-tech/eslint-config",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "description": "ESLint configuration for TypeScript projects",
5
5
  "keywords": [
6
6
  "eslint",