@dword-design/eslint-config 5.0.2 → 5.0.4

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.
@@ -1,10 +1,8 @@
1
- import compact from "@dword-design/functions/dist/compact.js";
2
- import filter from "@dword-design/functions/dist/filter.js";
3
- import join from "@dword-design/functions/dist/join.js";
4
- import map from "@dword-design/functions/dist/map.js";
5
- import omit from "@dword-design/functions/dist/omit.js";
1
+ import { compact, filter, join, map, omit } from '@dword-design/functions';
2
+ import confusingBrowserGlobals from 'confusing-browser-globals';
6
3
  import packageName from 'depcheck-package-name';
7
4
  import loadPkg from 'load-pkg';
5
+ import { without } from 'lodash-es';
8
6
  import { createRequire } from 'module';
9
7
  import restrictedImports from "./restricted-imports.js";
10
8
  const _require = createRequire(import.meta.url);
@@ -19,12 +17,11 @@ export default (() => {
19
17
  };
20
18
  })(_ref));
21
19
  return {
22
- env: {
23
- browser: true,
24
- es6: true,
25
- node: true
26
- },
27
20
  extends: [packageName`eslint-config-airbnb-base`, `plugin:${packageName`eslint-plugin-promise`}/recommended`, `plugin:${packageName`eslint-plugin-import`}/recommended`, `plugin:${packageName`@dword-design/eslint-plugin-import-alias`}/recommended`, `plugin:${packageName`eslint-plugin-vue`}/vue3-recommended`, `plugin:${packageName`eslint-plugin-prettier`}/recommended`],
21
+ globals: {
22
+ self: true,
23
+ window: true
24
+ },
28
25
  overrides: [{
29
26
  files: '**/*.spec.js',
30
27
  globals: {
@@ -77,6 +74,17 @@ export default (() => {
77
74
  'no-param-reassign': 'off',
78
75
  'no-promise-executor-return': 'off',
79
76
  'no-regex-spaces': 'off',
77
+ // https://github.com/facebook/create-react-app/issues/12847
78
+ 'no-restricted-globals': ['error', {
79
+ message: 'Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite',
80
+ name: 'isFinite'
81
+ }, {
82
+ message: 'Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan',
83
+ name: 'isNaN'
84
+ }, ...without(confusingBrowserGlobals, 'self').map(g => ({
85
+ message: `Use window.${g} instead. https://github.com/facebook/create-react-app/blob/HEAD/packages/confusing-browser-globals/README.md`,
86
+ name: g
87
+ }))],
80
88
  'no-restricted-imports': ['error', {
81
89
  paths: eslintRestrictedImports
82
90
  }],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dword-design/eslint-config",
3
- "version": "5.0.2",
3
+ "version": "5.0.4",
4
4
  "repository": "dword-design/eslint-config",
5
5
  "funding": "https://github.com/sponsors/dword-design",
6
6
  "license": "MIT",
@@ -22,9 +22,10 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@babel/eslint-parser": "^7.13.14",
25
- "@dword-design/babel-config": "^3.0.0",
25
+ "@dword-design/babel-config": "^4.0.0",
26
26
  "@dword-design/eslint-plugin-import-alias": "^4.0.8",
27
27
  "@dword-design/functions": "^5.0.22",
28
+ "confusing-browser-globals": "^1.0.11",
28
29
  "depcheck-package-name": "^3.0.0",
29
30
  "eslint-config-airbnb-base": "^15.0.0",
30
31
  "eslint-config-prettier": "^9.1.0",
@@ -42,6 +43,7 @@
42
43
  "eslint-plugin-vue": "^9.10.0",
43
44
  "jiti": "^1.18.2",
44
45
  "load-pkg": "^4.0.0",
46
+ "lodash-es": "^4.17.21",
45
47
  "prettier": "^3.2.4",
46
48
  "vue-eslint-parser": "^9.1.1"
47
49
  },