/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/namespace.md (2833B)
# import/namespace 💼 This rule is enabled in the following configs: ❗ `errors`, ☑️ `recommended`. Enforces names exist at the time they are dereferenced, when imported as a full namespace (i.e. `import * as foo from './foo'; foo.bar();` will report if `bar` is not exported by `./foo`.). Will report at the import declaration if there are _no_ exported names found. Also, will report for computed references (i.e. `foo["bar"]()`). Reports on assignment to a member of an imported namespace. Note: for packages, the plugin will find exported names from [`jsnext:main`], if present in `package.json`. Redux's npm module includes this key, and thereby is lintable, for example. A module path that is [ignored] or not [unambiguously an ES module] will not be reported when imported. [ignored]: ../README.md#importignore [unambiguously an ES module]: https://github.com/bmeck/UnambiguousJavaScriptGrammar ## Rule Details Currently, this rule does not check for possible redefinition of the namespace in an intermediate scope. Adherence to the ESLint `no-shadow` rule for namespaces will prevent this from being a problem. For [ES7], reports if an exported namespace would be empty (no names exported from the referenced module.) Given: ```js // @module ./named-exports export const a = 1 const b = 2 export { b } const c = 3 export { c as d } export class ExportedClass { } // ES7 export * as deep from './deep' ``` and: ```js // @module ./deep export const e = "MC2" ``` See what is valid and reported: ```js // @module ./foo import * as names from './named-exports' function great() { return names.a + names.b // so great https://youtu.be/ei7mb8UxEl8 } function notGreat() { doSomethingWith(names.c) // Reported: 'c' not found in imported namespace 'names'. const { a, b, c } = names // also reported, only for 'c' } // also tunnels through re-exported namespaces! function deepTrouble() { doSomethingWith(names.deep.e) // fine doSomethingWith(names.deep.f) // Reported: 'f' not found in deeply imported namespace 'names.deep'. } ``` ### Options #### `allowComputed` Defaults to `false`. When false, will report the following: ```js /*eslint import/namespace: [2, { allowComputed: false }]*/ import * as a from './a' function f(x) { return a[x] // Unable to validate computed reference to imported namespace 'a'. } ``` When set to `true`, the above computed namespace member reference is allowed, but still can't be statically analyzed any further. ## Further Reading - Lee Byron's [ES7] export proposal - [`import/ignore`] setting - [`jsnext:main`](Rollup) [ES7]: https://github.com/leebyron/ecmascript-more-export-from [`import/ignore`]: ../../README.md#importignore [`jsnext:main`]: https://github.com/rollup/rollup/wiki/jsnext:main