/home/techb158/balavpn.abdallabala.com/node_modules/eslint-plugin-import/docs/rules
NameSizeModeActions
consistent-type-specifier-style.md28220666editdlrm
default.md20160666editdlrm
dynamic-import-chunkname.md32880666editdlrm
enforce-node-protocol-usage.md21220666editdlrm
export.md9980666editdlrm
exports-last.md9350666editdlrm
extensions.md75580666editdlrm
first.md22300666editdlrm
group-exports.md24190666editdlrm
imports-first.md4240666editdlrm
max-dependencies.md18360666editdlrm
named.md26100666editdlrm
namespace.md28330666editdlrm
newline-after-import.md29030666editdlrm
no-absolute-path.md14860666editdlrm
no-amd.md9770666editdlrm
no-anonymous-default-export.md22350666editdlrm
no-commonjs.md22310666editdlrm
no-cycle.md37520666editdlrm
no-default-export.md12170666editdlrm
no-deprecated.md14780666editdlrm
no-duplicates.md35420666editdlrm
no-dynamic-require.md7800666editdlrm
no-empty-named-blocks.md8660666editdlrm
no-extraneous-dependencies.md48790666editdlrm
no-import-module-exports.md17800666editdlrm
no-internal-modules.md29270666editdlrm
no-mutable-exports.md14330666editdlrm
no-named-as-default-member.md14130666editdlrm
no-named-as-default.md13830666editdlrm
no-named-default.md7050666editdlrm
no-named-export.md14720666editdlrm
no-namespace.md9930666editdlrm
no-nodejs-modules.md8290666editdlrm
no-relative-packages.md14900666editdlrm
no-relative-parent-imports.md26210666editdlrm
no-restricted-paths.md48530666editdlrm
no-self-import.md4170666editdlrm
no-unassigned-import.md20010666editdlrm
no-unresolved.md43150666editdlrm
no-unused-modules.md34220666editdlrm
no-useless-path-segments.md25820666editdlrm
no-webpack-loader-syntax.md10810666editdlrm
order.md296320666editdlrm
prefer-default-export.md32630666editdlrm
unambiguous.md19130666editdlrm
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). 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