/
home
/
techb158
/
balavpn.abdallabala.com
/
node_modules
/
eslint-plugin-import
/
docs
/
rules
/
/home/techb158/balavpn.abdallabala.com/node_modules/eslint-plugin-import/docs/rules
mkdir
upload
Name
Size
Mode
Actions
consistent-type-specifier-style.md
2822
0666
edit
dl
rm
default.md
2016
0666
edit
dl
rm
dynamic-import-chunkname.md
3288
0666
edit
dl
rm
enforce-node-protocol-usage.md
2122
0666
edit
dl
rm
export.md
998
0666
edit
dl
rm
exports-last.md
935
0666
edit
dl
rm
extensions.md
7558
0666
edit
dl
rm
first.md
2230
0666
edit
dl
rm
group-exports.md
2419
0666
edit
dl
rm
imports-first.md
424
0666
edit
dl
rm
max-dependencies.md
1836
0666
edit
dl
rm
named.md
2610
0666
edit
dl
rm
namespace.md
2833
0666
edit
dl
rm
newline-after-import.md
2903
0666
edit
dl
rm
no-absolute-path.md
1486
0666
edit
dl
rm
no-amd.md
977
0666
edit
dl
rm
no-anonymous-default-export.md
2235
0666
edit
dl
rm
no-commonjs.md
2231
0666
edit
dl
rm
no-cycle.md
3752
0666
edit
dl
rm
no-default-export.md
1217
0666
edit
dl
rm
no-deprecated.md
1478
0666
edit
dl
rm
no-duplicates.md
3542
0666
edit
dl
rm
no-dynamic-require.md
780
0666
edit
dl
rm
no-empty-named-blocks.md
866
0666
edit
dl
rm
no-extraneous-dependencies.md
4879
0666
edit
dl
rm
no-import-module-exports.md
1780
0666
edit
dl
rm
no-internal-modules.md
2927
0666
edit
dl
rm
no-mutable-exports.md
1433
0666
edit
dl
rm
no-named-as-default-member.md
1413
0666
edit
dl
rm
no-named-as-default.md
1383
0666
edit
dl
rm
no-named-default.md
705
0666
edit
dl
rm
no-named-export.md
1472
0666
edit
dl
rm
no-namespace.md
993
0666
edit
dl
rm
no-nodejs-modules.md
829
0666
edit
dl
rm
no-relative-packages.md
1490
0666
edit
dl
rm
no-relative-parent-imports.md
2621
0666
edit
dl
rm
no-restricted-paths.md
4853
0666
edit
dl
rm
no-self-import.md
417
0666
edit
dl
rm
no-unassigned-import.md
2001
0666
edit
dl
rm
no-unresolved.md
4315
0666
edit
dl
rm
no-unused-modules.md
3422
0666
edit
dl
rm
no-useless-path-segments.md
2582
0666
edit
dl
rm
no-webpack-loader-syntax.md
1081
0666
edit
dl
rm
order.md
29632
0666
edit
dl
rm
prefer-default-export.md
3263
0666
edit
dl
rm
unambiguous.md
1913
0666
edit
dl
rm
Edit:
/home/techb158/balavpn.abdallabala.com/node_modules/eslint-plugin-import/docs/rules/first.md
(2230B)
# import/first 🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix). <!-- end auto-generated rule header --> This rule reports any imports that come after non-import statements. ## Rule Details ```js import foo from './foo' // some module-level initializer initWith(foo) import bar from './bar' // <- reported ``` Providing `absolute-first` as an option will report any absolute imports (i.e. packages) that come after any relative imports: ```js import foo from 'foo' import bar from './bar' import * as _ from 'lodash' // <- reported ``` If you really want import type ordering, check out [`import/order`]. Notably, `import`s are hoisted, which means the imported modules will be evaluated before any of the statements interspersed between them. Keeping all `import`s together at the top of the file may prevent surprises resulting from this part of the spec. ### On directives Directives are allowed as long as they occur strictly before any `import` declarations, as follows: ```js 'use super-mega-strict' import { suchFoo } from 'lame-fake-module-name' // no report here ``` A directive in this case is assumed to be a single statement that contains only a literal string-valued expression. `'use strict'` would be a good example, except that [modules are always in strict mode](https://262.ecma-international.org/6.0/#sec-strict-mode-code) so it would be surprising to see a `'use strict'` sharing a file with `import`s and `export`s. Given that, see [#255] for the reasoning. ### With Fixer This rule contains a fixer to reorder in-body import to top, the following criteria applied: 1. Never re-order relative to each other, even if `absolute-first` is set. 2. If an import creates an identifier, and that identifier is referenced at module level *before* the import itself, that won't be re-ordered. ## When Not To Use It If you don't mind imports being sprinkled throughout, you may not want to enable this rule. ## Further Reading - [`import/order`]: a major step up from `absolute-first` - Issue [#255] [`import/order`]: ./order.md [#255]: https://github.com/import-js/eslint-plugin-import/issues/255
Save
cmd:
run