immosquare-cleaner 0.1.34 → 0.1.35

Sign up to get free protection for your applications and to get access to all the features.
Files changed (191) hide show
  1. checksums.yaml +4 -4
  2. data/lib/immosquare-cleaner/version.rb +1 -1
  3. data/lib/immosquare-cleaner.rb +2 -2
  4. data/linters/eslint.config.mjs +30 -0
  5. data/linters/rubocop-3.2.2.yml +2 -0
  6. data/node_modules/function-bind/README.md +27 -25
  7. data/node_modules/function-bind/implementation.js +12 -44
  8. data/node_modules/function-bind/package.json +14 -38
  9. data/node_modules/is-core-module/CHANGELOG.md +0 -7
  10. data/node_modules/is-core-module/index.js +2 -2
  11. data/node_modules/is-core-module/package.json +4 -4
  12. data/package.json +2 -4
  13. metadata +3 -180
  14. data/linters/eslintrc.json +0 -57
  15. data/node_modules/.bin/rimraf +0 -1
  16. data/node_modules/eslint-config-airbnb-base/CHANGELOG.md +0 -374
  17. data/node_modules/eslint-config-airbnb-base/LICENSE.md +0 -21
  18. data/node_modules/eslint-config-airbnb-base/README.md +0 -112
  19. data/node_modules/eslint-config-airbnb-base/index.js +0 -17
  20. data/node_modules/eslint-config-airbnb-base/legacy.js +0 -34
  21. data/node_modules/eslint-config-airbnb-base/node_modules/semver/LICENSE +0 -15
  22. data/node_modules/eslint-config-airbnb-base/node_modules/semver/README.md +0 -443
  23. data/node_modules/eslint-config-airbnb-base/node_modules/semver/bin/semver.js +0 -174
  24. data/node_modules/eslint-config-airbnb-base/node_modules/semver/package.json +0 -38
  25. data/node_modules/eslint-config-airbnb-base/node_modules/semver/range.bnf +0 -16
  26. data/node_modules/eslint-config-airbnb-base/node_modules/semver/semver.js +0 -1643
  27. data/node_modules/eslint-config-airbnb-base/package.json +0 -95
  28. data/node_modules/eslint-config-airbnb-base/rules/best-practices.js +0 -408
  29. data/node_modules/eslint-config-airbnb-base/rules/errors.js +0 -179
  30. data/node_modules/eslint-config-airbnb-base/rules/es6.js +0 -185
  31. data/node_modules/eslint-config-airbnb-base/rules/imports.js +0 -273
  32. data/node_modules/eslint-config-airbnb-base/rules/node.js +0 -43
  33. data/node_modules/eslint-config-airbnb-base/rules/strict.js +0 -6
  34. data/node_modules/eslint-config-airbnb-base/rules/style.js +0 -529
  35. data/node_modules/eslint-config-airbnb-base/rules/variables.js +0 -56
  36. data/node_modules/eslint-config-airbnb-base/test/requires.js +0 -13
  37. data/node_modules/eslint-config-airbnb-base/test/test-base.js +0 -32
  38. data/node_modules/eslint-config-airbnb-base/whitespace-async.js +0 -96
  39. data/node_modules/eslint-config-airbnb-base/whitespace.js +0 -102
  40. data/node_modules/eslint-plugin-import/CHANGELOG.md +0 -1925
  41. data/node_modules/eslint-plugin-import/CONTRIBUTING.md +0 -84
  42. data/node_modules/eslint-plugin-import/LICENSE +0 -22
  43. data/node_modules/eslint-plugin-import/README.md +0 -500
  44. data/node_modules/eslint-plugin-import/RELEASE.md +0 -54
  45. data/node_modules/eslint-plugin-import/SECURITY.md +0 -11
  46. data/node_modules/eslint-plugin-import/config/electron.js +0 -8
  47. data/node_modules/eslint-plugin-import/config/errors.js +0 -14
  48. data/node_modules/eslint-plugin-import/config/react-native.js +0 -13
  49. data/node_modules/eslint-plugin-import/config/react.js +0 -18
  50. data/node_modules/eslint-plugin-import/config/recommended.js +0 -28
  51. data/node_modules/eslint-plugin-import/config/stage-0.js +0 -12
  52. data/node_modules/eslint-plugin-import/config/typescript.js +0 -34
  53. data/node_modules/eslint-plugin-import/config/warnings.js +0 -12
  54. data/node_modules/eslint-plugin-import/docs/rules/consistent-type-specifier-style.md +0 -91
  55. data/node_modules/eslint-plugin-import/docs/rules/default.md +0 -72
  56. data/node_modules/eslint-plugin-import/docs/rules/dynamic-import-chunkname.md +0 -92
  57. data/node_modules/eslint-plugin-import/docs/rules/export.md +0 -37
  58. data/node_modules/eslint-plugin-import/docs/rules/exports-last.md +0 -51
  59. data/node_modules/eslint-plugin-import/docs/rules/extensions.md +0 -174
  60. data/node_modules/eslint-plugin-import/docs/rules/first.md +0 -75
  61. data/node_modules/eslint-plugin-import/docs/rules/group-exports.md +0 -118
  62. data/node_modules/eslint-plugin-import/docs/rules/imports-first.md +0 -9
  63. data/node_modules/eslint-plugin-import/docs/rules/max-dependencies.md +0 -70
  64. data/node_modules/eslint-plugin-import/docs/rules/named.md +0 -102
  65. data/node_modules/eslint-plugin-import/docs/rules/namespace.md +0 -106
  66. data/node_modules/eslint-plugin-import/docs/rules/newline-after-import.md +0 -167
  67. data/node_modules/eslint-plugin-import/docs/rules/no-absolute-path.md +0 -54
  68. data/node_modules/eslint-plugin-import/docs/rules/no-amd.md +0 -37
  69. data/node_modules/eslint-plugin-import/docs/rules/no-anonymous-default-export.md +0 -83
  70. data/node_modules/eslint-plugin-import/docs/rules/no-commonjs.md +0 -96
  71. data/node_modules/eslint-plugin-import/docs/rules/no-cycle.md +0 -111
  72. data/node_modules/eslint-plugin-import/docs/rules/no-default-export.md +0 -65
  73. data/node_modules/eslint-plugin-import/docs/rules/no-deprecated.md +0 -62
  74. data/node_modules/eslint-plugin-import/docs/rules/no-duplicates.md +0 -109
  75. data/node_modules/eslint-plugin-import/docs/rules/no-dynamic-require.md +0 -25
  76. data/node_modules/eslint-plugin-import/docs/rules/no-empty-named-blocks.md +0 -49
  77. data/node_modules/eslint-plugin-import/docs/rules/no-extraneous-dependencies.md +0 -139
  78. data/node_modules/eslint-plugin-import/docs/rules/no-import-module-exports.md +0 -81
  79. data/node_modules/eslint-plugin-import/docs/rules/no-internal-modules.md +0 -136
  80. data/node_modules/eslint-plugin-import/docs/rules/no-mutable-exports.md +0 -54
  81. data/node_modules/eslint-plugin-import/docs/rules/no-named-as-default-member.md +0 -52
  82. data/node_modules/eslint-plugin-import/docs/rules/no-named-as-default.md +0 -53
  83. data/node_modules/eslint-plugin-import/docs/rules/no-named-default.md +0 -36
  84. data/node_modules/eslint-plugin-import/docs/rules/no-named-export.md +0 -79
  85. data/node_modules/eslint-plugin-import/docs/rules/no-namespace.md +0 -44
  86. data/node_modules/eslint-plugin-import/docs/rules/no-nodejs-modules.md +0 -42
  87. data/node_modules/eslint-plugin-import/docs/rules/no-relative-packages.md +0 -70
  88. data/node_modules/eslint-plugin-import/docs/rules/no-relative-parent-imports.md +0 -123
  89. data/node_modules/eslint-plugin-import/docs/rules/no-restricted-paths.md +0 -198
  90. data/node_modules/eslint-plugin-import/docs/rules/no-self-import.md +0 -32
  91. data/node_modules/eslint-plugin-import/docs/rules/no-unassigned-import.md +0 -60
  92. data/node_modules/eslint-plugin-import/docs/rules/no-unresolved.md +0 -110
  93. data/node_modules/eslint-plugin-import/docs/rules/no-unused-modules.md +0 -125
  94. data/node_modules/eslint-plugin-import/docs/rules/no-useless-path-segments.md +0 -85
  95. data/node_modules/eslint-plugin-import/docs/rules/no-webpack-loader-syntax.md +0 -39
  96. data/node_modules/eslint-plugin-import/docs/rules/order.md +0 -365
  97. data/node_modules/eslint-plugin-import/docs/rules/prefer-default-export.md +0 -185
  98. data/node_modules/eslint-plugin-import/docs/rules/unambiguous.md +0 -57
  99. data/node_modules/eslint-plugin-import/lib/ExportMap.js +0 -856
  100. data/node_modules/eslint-plugin-import/lib/core/importType.js +0 -129
  101. data/node_modules/eslint-plugin-import/lib/core/packagePath.js +0 -22
  102. data/node_modules/eslint-plugin-import/lib/core/staticRequire.js +0 -11
  103. data/node_modules/eslint-plugin-import/lib/docsUrl.js +0 -8
  104. data/node_modules/eslint-plugin-import/lib/importDeclaration.js +0 -5
  105. data/node_modules/eslint-plugin-import/lib/index.js +0 -71
  106. data/node_modules/eslint-plugin-import/lib/rules/consistent-type-specifier-style.js +0 -221
  107. data/node_modules/eslint-plugin-import/lib/rules/default.js +0 -40
  108. data/node_modules/eslint-plugin-import/lib/rules/dynamic-import-chunkname.js +0 -120
  109. data/node_modules/eslint-plugin-import/lib/rules/export.js +0 -250
  110. data/node_modules/eslint-plugin-import/lib/rules/exports-last.js +0 -40
  111. data/node_modules/eslint-plugin-import/lib/rules/extensions.js +0 -193
  112. data/node_modules/eslint-plugin-import/lib/rules/first.js +0 -144
  113. data/node_modules/eslint-plugin-import/lib/rules/group-exports.js +0 -155
  114. data/node_modules/eslint-plugin-import/lib/rules/imports-first.js +0 -16
  115. data/node_modules/eslint-plugin-import/lib/rules/max-dependencies.js +0 -60
  116. data/node_modules/eslint-plugin-import/lib/rules/named.js +0 -143
  117. data/node_modules/eslint-plugin-import/lib/rules/namespace.js +0 -218
  118. data/node_modules/eslint-plugin-import/lib/rules/newline-after-import.js +0 -237
  119. data/node_modules/eslint-plugin-import/lib/rules/no-absolute-path.js +0 -40
  120. data/node_modules/eslint-plugin-import/lib/rules/no-amd.js +0 -47
  121. data/node_modules/eslint-plugin-import/lib/rules/no-anonymous-default-export.js +0 -103
  122. data/node_modules/eslint-plugin-import/lib/rules/no-commonjs.js +0 -141
  123. data/node_modules/eslint-plugin-import/lib/rules/no-cycle.js +0 -158
  124. data/node_modules/eslint-plugin-import/lib/rules/no-default-export.js +0 -43
  125. data/node_modules/eslint-plugin-import/lib/rules/no-deprecated.js +0 -138
  126. data/node_modules/eslint-plugin-import/lib/rules/no-duplicates.js +0 -354
  127. data/node_modules/eslint-plugin-import/lib/rules/no-dynamic-require.js +0 -77
  128. data/node_modules/eslint-plugin-import/lib/rules/no-empty-named-blocks.js +0 -105
  129. data/node_modules/eslint-plugin-import/lib/rules/no-extraneous-dependencies.js +0 -301
  130. data/node_modules/eslint-plugin-import/lib/rules/no-import-module-exports.js +0 -85
  131. data/node_modules/eslint-plugin-import/lib/rules/no-internal-modules.js +0 -144
  132. data/node_modules/eslint-plugin-import/lib/rules/no-mutable-exports.js +0 -59
  133. data/node_modules/eslint-plugin-import/lib/rules/no-named-as-default-member.js +0 -96
  134. data/node_modules/eslint-plugin-import/lib/rules/no-named-as-default.js +0 -45
  135. data/node_modules/eslint-plugin-import/lib/rules/no-named-default.js +0 -31
  136. data/node_modules/eslint-plugin-import/lib/rules/no-named-export.js +0 -39
  137. data/node_modules/eslint-plugin-import/lib/rules/no-namespace.js +0 -175
  138. data/node_modules/eslint-plugin-import/lib/rules/no-nodejs-modules.js +0 -44
  139. data/node_modules/eslint-plugin-import/lib/rules/no-relative-packages.js +0 -71
  140. data/node_modules/eslint-plugin-import/lib/rules/no-relative-parent-imports.js +0 -48
  141. data/node_modules/eslint-plugin-import/lib/rules/no-restricted-paths.js +0 -245
  142. data/node_modules/eslint-plugin-import/lib/rules/no-self-import.js +0 -39
  143. data/node_modules/eslint-plugin-import/lib/rules/no-unassigned-import.js +0 -79
  144. data/node_modules/eslint-plugin-import/lib/rules/no-unresolved.js +0 -60
  145. data/node_modules/eslint-plugin-import/lib/rules/no-unused-modules.js +0 -945
  146. data/node_modules/eslint-plugin-import/lib/rules/no-useless-path-segments.js +0 -147
  147. data/node_modules/eslint-plugin-import/lib/rules/no-webpack-loader-syntax.js +0 -26
  148. data/node_modules/eslint-plugin-import/lib/rules/order.js +0 -785
  149. data/node_modules/eslint-plugin-import/lib/rules/prefer-default-export.js +0 -116
  150. data/node_modules/eslint-plugin-import/lib/rules/unambiguous.js +0 -38
  151. data/node_modules/eslint-plugin-import/memo-parser/LICENSE +0 -22
  152. data/node_modules/eslint-plugin-import/memo-parser/README.md +0 -21
  153. data/node_modules/eslint-plugin-import/memo-parser/index.js +0 -41
  154. data/node_modules/eslint-plugin-import/node_modules/debug/CHANGELOG.md +0 -395
  155. data/node_modules/eslint-plugin-import/node_modules/debug/LICENSE +0 -19
  156. data/node_modules/eslint-plugin-import/node_modules/debug/README.md +0 -437
  157. data/node_modules/eslint-plugin-import/node_modules/debug/node.js +0 -1
  158. data/node_modules/eslint-plugin-import/node_modules/debug/node_modules/ms/index.js +0 -162
  159. data/node_modules/eslint-plugin-import/node_modules/debug/node_modules/ms/license.md +0 -21
  160. data/node_modules/eslint-plugin-import/node_modules/debug/node_modules/ms/package.json +0 -38
  161. data/node_modules/eslint-plugin-import/node_modules/debug/node_modules/ms/readme.md +0 -59
  162. data/node_modules/eslint-plugin-import/node_modules/debug/package.json +0 -51
  163. data/node_modules/eslint-plugin-import/node_modules/debug/src/browser.js +0 -180
  164. data/node_modules/eslint-plugin-import/node_modules/debug/src/common.js +0 -249
  165. data/node_modules/eslint-plugin-import/node_modules/debug/src/index.js +0 -12
  166. data/node_modules/eslint-plugin-import/node_modules/debug/src/node.js +0 -177
  167. data/node_modules/eslint-plugin-import/node_modules/doctrine/CHANGELOG.md +0 -94
  168. data/node_modules/eslint-plugin-import/node_modules/doctrine/LICENSE +0 -177
  169. data/node_modules/eslint-plugin-import/node_modules/doctrine/LICENSE.closure-compiler +0 -202
  170. data/node_modules/eslint-plugin-import/node_modules/doctrine/LICENSE.esprima +0 -19
  171. data/node_modules/eslint-plugin-import/node_modules/doctrine/README.md +0 -165
  172. data/node_modules/eslint-plugin-import/node_modules/doctrine/lib/doctrine.js +0 -899
  173. data/node_modules/eslint-plugin-import/node_modules/doctrine/lib/typed.js +0 -1305
  174. data/node_modules/eslint-plugin-import/node_modules/doctrine/lib/utility.js +0 -35
  175. data/node_modules/eslint-plugin-import/node_modules/doctrine/package.json +0 -57
  176. data/node_modules/eslint-plugin-import/node_modules/minimatch/LICENSE +0 -15
  177. data/node_modules/eslint-plugin-import/node_modules/minimatch/README.md +0 -230
  178. data/node_modules/eslint-plugin-import/node_modules/minimatch/minimatch.js +0 -947
  179. data/node_modules/eslint-plugin-import/node_modules/minimatch/node_modules/brace-expansion/LICENSE +0 -21
  180. data/node_modules/eslint-plugin-import/node_modules/minimatch/node_modules/brace-expansion/README.md +0 -129
  181. data/node_modules/eslint-plugin-import/node_modules/minimatch/node_modules/brace-expansion/index.js +0 -201
  182. data/node_modules/eslint-plugin-import/node_modules/minimatch/node_modules/brace-expansion/package.json +0 -47
  183. data/node_modules/eslint-plugin-import/node_modules/minimatch/package.json +0 -33
  184. data/node_modules/eslint-plugin-import/node_modules/semver/LICENSE +0 -15
  185. data/node_modules/eslint-plugin-import/node_modules/semver/README.md +0 -443
  186. data/node_modules/eslint-plugin-import/node_modules/semver/bin/semver.js +0 -174
  187. data/node_modules/eslint-plugin-import/node_modules/semver/package.json +0 -38
  188. data/node_modules/eslint-plugin-import/node_modules/semver/range.bnf +0 -16
  189. data/node_modules/eslint-plugin-import/node_modules/semver/semver.js +0 -1643
  190. data/node_modules/eslint-plugin-import/package.json +0 -124
  191. data/node_modules/function-bind/CHANGELOG.md +0 -136
@@ -1,139 +0,0 @@
1
- # import/no-extraneous-dependencies
2
-
3
- <!-- end auto-generated rule header -->
4
-
5
- Forbid the import of external modules that are not declared in the `package.json`'s `dependencies`, `devDependencies`, `optionalDependencies`, `peerDependencies`, or `bundledDependencies`.
6
- The closest parent `package.json` will be used. If no `package.json` is found, the rule will not lint anything. This behavior can be changed with the rule option `packageDir`. Normally ignores imports of modules marked internal, but this can be changed with the rule option `includeInternal`. Type imports can be verified by specifying `includeTypes`.
7
-
8
- Modules have to be installed for this rule to work.
9
-
10
- ## Options
11
-
12
- This rule supports the following options:
13
-
14
- `devDependencies`: If set to `false`, then the rule will show an error when `devDependencies` are imported. Defaults to `true`.
15
- Type imports are ignored by default.
16
-
17
- `optionalDependencies`: If set to `false`, then the rule will show an error when `optionalDependencies` are imported. Defaults to `true`.
18
-
19
- `peerDependencies`: If set to `false`, then the rule will show an error when `peerDependencies` are imported. Defaults to `true`.
20
-
21
- `bundledDependencies`: If set to `false`, then the rule will show an error when `bundledDependencies` are imported. Defaults to `true`.
22
-
23
- You can set the options like this:
24
-
25
- ```js
26
- "import/no-extraneous-dependencies": ["error", {"devDependencies": false, "optionalDependencies": false, "peerDependencies": false}]
27
- ```
28
-
29
- You can also use an array of globs instead of literal booleans:
30
-
31
- ```js
32
- "import/no-extraneous-dependencies": ["error", {"devDependencies": ["**/*.test.js", "**/*.spec.js"]}]
33
- ```
34
-
35
- When using an array of globs, the setting will be set to `true` (no errors reported) if the name of the file being linted matches a single glob in the array, and `false` otherwise.
36
-
37
- There are 2 boolean options to opt into checking extra imports that are normally ignored: `includeInternal`, which enables the checking of internal modules, and `includeTypes`, which enables checking of type imports in TypeScript.
38
-
39
- ```js
40
- "import/no-extraneous-dependencies": ["error", {"includeInternal": true, "includeTypes": true}]
41
- ```
42
-
43
- Also there is one more option called `packageDir`, this option is to specify the path to the folder containing package.json.
44
-
45
- If provided as a relative path string, will be computed relative to the current working directory at linter execution time. If this is not ideal (does not work with some editor integrations), consider using `__dirname` to provide a path relative to your configuration.
46
-
47
- ```js
48
- "import/no-extraneous-dependencies": ["error", {"packageDir": './some-dir/'}]
49
- // or
50
- "import/no-extraneous-dependencies": ["error", {"packageDir": path.join(__dirname, 'some-dir')}]
51
- ```
52
-
53
- It may also be an array of multiple paths, to support monorepos or other novel project
54
- folder layouts:
55
-
56
- ```js
57
- "import/no-extraneous-dependencies": ["error", {"packageDir": ['./some-dir/', './root-pkg']}]
58
- ```
59
-
60
- ## Rule Details
61
-
62
- Given the following `package.json`:
63
-
64
- ```json
65
- {
66
- "name": "my-project",
67
- "...": "...",
68
- "dependencies": {
69
- "builtin-modules": "^1.1.1",
70
- "lodash.cond": "^4.2.0",
71
- "lodash.find": "^4.2.0",
72
- "pkg-up": "^1.0.0"
73
- },
74
- "devDependencies": {
75
- "ava": "^0.13.0",
76
- "eslint": "^2.4.0",
77
- "eslint-plugin-ava": "^1.3.0",
78
- "xo": "^0.13.0"
79
- },
80
- "optionalDependencies": {
81
- "lodash.isarray": "^4.0.0"
82
- },
83
- "peerDependencies": {
84
- "react": ">=15.0.0 <16.0.0"
85
- },
86
- "bundledDependencies": [
87
- "@generated/foo",
88
- ]
89
- }
90
- ```
91
-
92
- ## Fail
93
-
94
- ```js
95
- var _ = require('lodash');
96
- import _ from 'lodash';
97
-
98
- import react from 'react';
99
-
100
- /* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": false}] */
101
- import test from 'ava';
102
- var test = require('ava');
103
-
104
- /* eslint import/no-extraneous-dependencies: ["error", {"optionalDependencies": false}] */
105
- import isArray from 'lodash.isarray';
106
- var isArray = require('lodash.isarray');
107
-
108
- /* eslint import/no-extraneous-dependencies: ["error", {"bundledDependencies": false}] */
109
- import foo from '"@generated/foo"';
110
- var foo = require('"@generated/foo"');
111
-
112
- /* eslint import/no-extraneous-dependencies: ["error", {"includeInternal": true}] */
113
- import foo from './foo';
114
- var foo = require('./foo');
115
-
116
- /* eslint import/no-extraneous-dependencies: ["error", {"includeTypes": true}] */
117
- import type { MyType } from 'foo';
118
- ```
119
-
120
- ## Pass
121
-
122
- ```js
123
- // Builtin and internal modules are fine
124
- var path = require('path');
125
- var foo = require('./foo');
126
-
127
- import test from 'ava';
128
- import find from 'lodash.find';
129
- import isArray from 'lodash.isarray';
130
- import foo from '"@generated/foo"';
131
- import type { MyType } from 'foo';
132
-
133
- /* eslint import/no-extraneous-dependencies: ["error", {"peerDependencies": true}] */
134
- import react from 'react';
135
- ```
136
-
137
- ## When Not To Use It
138
-
139
- If you do not have a `package.json` file in your project.
@@ -1,81 +0,0 @@
1
- # import/no-import-module-exports
2
-
3
- 🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
4
-
5
- <!-- end auto-generated rule header -->
6
-
7
- Reports the use of import declarations with CommonJS exports in any module
8
- except for the [main module](https://docs.npmjs.com/files/package.json#main).
9
-
10
- If you have multiple entry points or are using `js:next` this rule includes an
11
- `exceptions` option which you can use to exclude those files from the rule.
12
-
13
- ## Options
14
-
15
- ### `exceptions`
16
-
17
- - An array of globs. The rule will be omitted from any file that matches a glob
18
- in the options array. For example, the following setting will omit the rule
19
- in the `some-file.js` file.
20
-
21
- ```json
22
- "import/no-import-module-exports": ["error", {
23
- "exceptions": ["**/*/some-file.js"]
24
- }]
25
- ```
26
-
27
- ## Rule Details
28
-
29
- ### Fail
30
-
31
- ```js
32
- import { stuff } from 'starwars'
33
- module.exports = thing
34
-
35
- import * as allThings from 'starwars'
36
- exports.bar = thing
37
-
38
- import thing from 'other-thing'
39
- exports.foo = bar
40
-
41
- import thing from 'starwars'
42
- const baz = module.exports = thing
43
- console.log(baz)
44
- ```
45
-
46
- ### Pass
47
-
48
- Given the following package.json:
49
-
50
- ```json
51
- {
52
- "main": "lib/index.js",
53
- }
54
- ```
55
-
56
- ```js
57
- import thing from 'other-thing'
58
- export default thing
59
-
60
- const thing = require('thing')
61
- module.exports = thing
62
-
63
- const thing = require('thing')
64
- exports.foo = bar
65
-
66
- import thing from 'otherthing'
67
- console.log(thing.module.exports)
68
-
69
- // in lib/index.js
70
- import foo from 'path';
71
- module.exports = foo;
72
-
73
- // in some-file.js
74
- // eslint import/no-import-module-exports: ["error", {"exceptions": ["**/*/some-file.js"]}]
75
- import foo from 'path';
76
- module.exports = foo;
77
- ```
78
-
79
- ### Further Reading
80
-
81
- - [webpack issue #4039](https://github.com/webpack/webpack/issues/4039)
@@ -1,136 +0,0 @@
1
- # import/no-internal-modules
2
-
3
- <!-- end auto-generated rule header -->
4
-
5
- Use this rule to prevent importing the submodules of other modules.
6
-
7
- ## Rule Details
8
-
9
- This rule has two mutally exclusive options that are arrays of [minimatch/glob patterns](https://github.com/isaacs/node-glob#glob-primer) patterns:
10
-
11
- - `allow` that include paths and import statements that can be imported with reaching.
12
- - `forbid` that exclude paths and import statements that can be imported with reaching.
13
-
14
- ### Examples
15
-
16
- Given the following folder structure:
17
-
18
- ```pt
19
- my-project
20
- ├── actions
21
- │ └── getUser.js
22
- │ └── updateUser.js
23
- ├── reducer
24
- │ └── index.js
25
- │ └── user.js
26
- ├── redux
27
- │ └── index.js
28
- │ └── configureStore.js
29
- └── app
30
- │ └── index.js
31
- │ └── settings.js
32
- └── entry.js
33
- ```
34
-
35
- And the .eslintrc file:
36
-
37
- ```json
38
- {
39
- ...
40
- "rules": {
41
- "import/no-internal-modules": [ "error", {
42
- "allow": [ "**/actions/*", "source-map-support/*" ],
43
- } ]
44
- }
45
- }
46
- ```
47
-
48
- The following patterns are considered problems:
49
-
50
- ```js
51
- /**
52
- * in my-project/entry.js
53
- */
54
-
55
- import { settings } from './app/index'; // Reaching to "./app/index" is not allowed
56
- import userReducer from './reducer/user'; // Reaching to "./reducer/user" is not allowed
57
- import configureStore from './redux/configureStore'; // Reaching to "./redux/configureStore" is not allowed
58
-
59
- export { settings } from './app/index'; // Reaching to "./app/index" is not allowed
60
- export * from './reducer/user'; // Reaching to "./reducer/user" is not allowed
61
- ```
62
-
63
- The following patterns are NOT considered problems:
64
-
65
- ```js
66
- /**
67
- * in my-project/entry.js
68
- */
69
-
70
- import 'source-map-support/register';
71
- import { settings } from '../app';
72
- import getUser from '../actions/getUser';
73
-
74
- export * from 'source-map-support/register';
75
- export { settings } from '../app';
76
- ```
77
-
78
- Given the following folder structure:
79
-
80
- ```pt
81
- my-project
82
- ├── actions
83
- │ └── getUser.js
84
- │ └── updateUser.js
85
- ├── reducer
86
- │ └── index.js
87
- │ └── user.js
88
- ├── redux
89
- │ └── index.js
90
- │ └── configureStore.js
91
- └── app
92
- │ └── index.js
93
- │ └── settings.js
94
- └── entry.js
95
- ```
96
-
97
- And the .eslintrc file:
98
-
99
- ```json
100
- {
101
- ...
102
- "rules": {
103
- "import/no-internal-modules": [ "error", {
104
- "forbid": [ "**/actions/*", "source-map-support/*" ],
105
- } ]
106
- }
107
- }
108
- ```
109
-
110
- The following patterns are considered problems:
111
-
112
- ```js
113
- /**
114
- * in my-project/entry.js
115
- */
116
-
117
- import 'source-map-support/register';
118
- import getUser from '../actions/getUser';
119
-
120
- export * from 'source-map-support/register';
121
- export getUser from '../actions/getUser';
122
- ```
123
-
124
- The following patterns are NOT considered problems:
125
-
126
- ```js
127
- /**
128
- * in my-project/entry.js
129
- */
130
-
131
- import 'source-map-support';
132
- import { getUser } from '../actions';
133
-
134
- export * from 'source-map-support';
135
- export { getUser } from '../actions';
136
- ```
@@ -1,54 +0,0 @@
1
- # import/no-mutable-exports
2
-
3
- <!-- end auto-generated rule header -->
4
-
5
- Forbids the use of mutable exports with `var` or `let`.
6
-
7
- ## Rule Details
8
-
9
- Valid:
10
-
11
- ```js
12
- export const count = 1
13
- export function getCount() {}
14
- export class Counter {}
15
- ```
16
-
17
- ...whereas here exports will be reported:
18
-
19
- ```js
20
- export let count = 2
21
- export var count = 3
22
-
23
- let count = 4
24
- export { count } // reported here
25
- ```
26
-
27
- ## Functions/Classes
28
-
29
- Note that exported function/class declaration identifiers may be reassigned,
30
- but are not flagged by this rule at this time. They may be in the future, if a
31
- reassignment is detected, i.e.
32
-
33
- ```js
34
- // possible future behavior!
35
- export class Counter {} // reported here: exported class is reassigned on line [x].
36
- Counter = KitchenSink // not reported here unless you enable no-class-assign
37
-
38
- // this pre-declaration reassignment is valid on account of function hoisting
39
- getCount = function getDuke() {} // not reported here without no-func-assign
40
- export function getCount() {} // reported here: exported function is reassigned on line [x].
41
- ```
42
-
43
- To prevent general reassignment of these identifiers, exported or not, you may
44
- want to enable the following core ESLint rules:
45
-
46
- - [no-func-assign]
47
- - [no-class-assign]
48
-
49
- [no-func-assign]: https://eslint.org/docs/rules/no-func-assign
50
- [no-class-assign]: https://eslint.org/docs/rules/no-class-assign
51
-
52
- ## When Not To Use It
53
-
54
- If your environment correctly implements mutable export bindings.
@@ -1,52 +0,0 @@
1
- # import/no-named-as-default-member
2
-
3
- ⚠️ This rule _warns_ in the following configs: ☑️ `recommended`, 🚸 `warnings`.
4
-
5
- <!-- end auto-generated rule header -->
6
-
7
- Reports use of an exported name as a property on the default export.
8
-
9
- Rationale: Accessing a property that has a name that is shared by an exported
10
- name from the same module is likely to be a mistake.
11
-
12
- Named import syntax looks very similar to destructuring assignment. It's easy to
13
- make the (incorrect) assumption that named exports are also accessible as
14
- properties of the default export.
15
-
16
- Furthermore, [in Babel 5 this is actually how things worked][blog]. This was
17
- fixed in Babel 6. Before upgrading an existing codebase to Babel 6, it can be
18
- useful to run this lint rule.
19
-
20
- [blog]: https://kentcdodds.com/blog/misunderstanding-es6-modules-upgrading-babel-tears-and-a-solution
21
-
22
- ## Rule Details
23
-
24
- Given:
25
-
26
- ```js
27
- // foo.js
28
- export default 'foo';
29
- export const bar = 'baz';
30
- ```
31
-
32
- ...this would be valid:
33
-
34
- ```js
35
- import foo, {bar} from './foo.js';
36
- ```
37
-
38
- ...and the following would be reported:
39
-
40
- ```js
41
- // Caution: `foo` also has a named export `bar`.
42
- // Check if you meant to write `import {bar} from './foo.js'` instead.
43
- import foo from './foo.js';
44
- const bar = foo.bar;
45
- ```
46
-
47
- ```js
48
- // Caution: `foo` also has a named export `bar`.
49
- // Check if you meant to write `import {bar} from './foo.js'` instead.
50
- import foo from './foo.js';
51
- const {bar} = foo;
52
- ```
@@ -1,53 +0,0 @@
1
- # import/no-named-as-default
2
-
3
- ⚠️ This rule _warns_ in the following configs: ☑️ `recommended`, 🚸 `warnings`.
4
-
5
- <!-- end auto-generated rule header -->
6
-
7
- Reports use of an exported name as the locally imported name of a default export.
8
-
9
- Rationale: using an exported name as the name of the default export is likely...
10
-
11
- - _misleading_: others familiar with `foo.js` probably expect the name to be `foo`
12
- - _a mistake_: only needed to import `bar` and forgot the brackets (the case that is prompting this)
13
-
14
- ## Rule Details
15
-
16
- Given:
17
-
18
- ```js
19
- // foo.js
20
- export default 'foo';
21
- export const bar = 'baz';
22
- ```
23
-
24
- ...this would be valid:
25
-
26
- ```js
27
- import foo from './foo.js';
28
- ```
29
-
30
- ...and this would be reported:
31
-
32
- ```js
33
- // message: Using exported name 'bar' as identifier for default export.
34
- import bar from './foo.js';
35
- ```
36
-
37
- For post-ES2015 `export` extensions, this also prevents exporting the default from a referenced module as a name within that module, for the same reasons:
38
-
39
- ```js
40
- // valid:
41
- export foo from './foo.js';
42
-
43
- // message: Using exported name 'bar' as identifier for default export.
44
- export bar from './foo.js';
45
- ```
46
-
47
- ## Further Reading
48
-
49
- - ECMAScript Proposal: [export ns from]
50
- - ECMAScript Proposal: [export default from]
51
-
52
- [export ns from]: https://github.com/leebyron/ecmascript-export-ns-from
53
- [export default from]: https://github.com/leebyron/ecmascript-export-default-from
@@ -1,36 +0,0 @@
1
- # import/no-named-default
2
-
3
- <!-- end auto-generated rule header -->
4
-
5
- Reports use of a default export as a locally named import.
6
-
7
- Rationale: the syntax exists to import default exports expressively, let's use it.
8
-
9
- Note that type imports, as used by [Flow], are always ignored.
10
-
11
- [Flow]: https://flow.org/
12
-
13
- ## Rule Details
14
-
15
- Given:
16
-
17
- ```js
18
- // foo.js
19
- export default 'foo';
20
- export const bar = 'baz';
21
- ```
22
-
23
- ...these would be valid:
24
-
25
- ```js
26
- import foo from './foo.js';
27
- import foo, { bar } from './foo.js';
28
- ```
29
-
30
- ...and these would be reported:
31
-
32
- ```js
33
- // message: Using exported name 'bar' as identifier for default export.
34
- import { default as foo } from './foo.js';
35
- import { default as foo, bar } from './foo.js';
36
- ```
@@ -1,79 +0,0 @@
1
- # import/no-named-export
2
-
3
- <!-- end auto-generated rule header -->
4
-
5
- Prohibit named exports. Mostly an inverse of [`no-default-export`].
6
-
7
- [`no-default-export`]: ./no-default-export.md
8
-
9
- ## Rule Details
10
-
11
- The following patterns are considered warnings:
12
-
13
- ```javascript
14
- // bad1.js
15
-
16
- // There is only a single module export and it's a named export.
17
- export const foo = 'foo';
18
- ```
19
-
20
- ```javascript
21
- // bad2.js
22
-
23
- // There is more than one named export in the module.
24
- export const foo = 'foo';
25
- export const bar = 'bar';
26
- ```
27
-
28
- ```javascript
29
- // bad3.js
30
-
31
- // There is more than one named export in the module.
32
- const foo = 'foo';
33
- const bar = 'bar';
34
- export { foo, bar }
35
- ```
36
-
37
- ```javascript
38
- // bad4.js
39
-
40
- // There is more than one named export in the module.
41
- export * from './other-module'
42
- ```
43
-
44
- ```javascript
45
- // bad5.js
46
-
47
- // There is a default and a named export.
48
- export const foo = 'foo';
49
- const bar = 'bar';
50
- export default 'bar';
51
- ```
52
-
53
- The following patterns are not warnings:
54
-
55
- ```javascript
56
- // good1.js
57
-
58
- // There is only a single module export and it's a default export.
59
- export default 'bar';
60
- ```
61
-
62
- ```javascript
63
- // good2.js
64
-
65
- // There is only a single module export and it's a default export.
66
- const foo = 'foo';
67
- export { foo as default }
68
- ```
69
-
70
- ```javascript
71
- // good3.js
72
-
73
- // There is only a single module export and it's a default export.
74
- export default from './other-module';
75
- ```
76
-
77
- ## When Not To Use It
78
-
79
- If you don't care if named imports are used, or if you prefer named imports over default imports.
@@ -1,44 +0,0 @@
1
- # import/no-namespace
2
-
3
- 🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
4
-
5
- <!-- end auto-generated rule header -->
6
-
7
- Enforce a convention of not using namespace (a.k.a. "wildcard" `*`) imports.
8
-
9
- The rule is auto-fixable when the namespace object is only used for direct member access, e.g. `namespace.a`.
10
-
11
- ## Options
12
-
13
- This rule supports the following options:
14
-
15
- - `ignore`: array of glob strings for modules that should be ignored by the rule.
16
-
17
- ## Rule Details
18
-
19
- Valid:
20
-
21
- ```js
22
- import defaultExport from './foo'
23
- import { a, b } from './bar'
24
- import defaultExport, { a, b } from './foobar'
25
- ```
26
-
27
- ```js
28
- /* eslint import/no-namespace: ["error", {ignore: ['*.ext']}] */
29
- import * as bar from './ignored-module.ext';
30
- ```
31
-
32
- Invalid:
33
-
34
- ```js
35
- import * as foo from 'foo';
36
- ```
37
-
38
- ```js
39
- import defaultExport, * as foo from 'foo';
40
- ```
41
-
42
- ## When Not To Use It
43
-
44
- If you want to use namespaces, you don't want to use this rule.