Website Structure
This commit is contained in:
parent
62812f2090
commit
71f0676a62
22365 changed files with 4265753 additions and 791 deletions
32
Frontend-Learner/node_modules/eslint-plugin-import-x/lib/rules/no-self-import.js
generated
vendored
Normal file
32
Frontend-Learner/node_modules/eslint-plugin-import-x/lib/rules/no-self-import.js
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import { createRule, moduleVisitor, resolve } from '../utils/index.js';
|
||||
function isImportingSelf(context, node, requireName) {
|
||||
const filename = context.physicalFilename;
|
||||
if (filename !== '<text>' && filename === resolve(requireName, context)) {
|
||||
context.report({
|
||||
node,
|
||||
messageId: 'self',
|
||||
});
|
||||
}
|
||||
}
|
||||
export default createRule({
|
||||
name: 'no-self-import',
|
||||
meta: {
|
||||
type: 'problem',
|
||||
docs: {
|
||||
category: 'Static analysis',
|
||||
description: 'Forbid a module from importing itself.',
|
||||
recommended: true,
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
self: 'Module imports itself.',
|
||||
},
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return moduleVisitor((source, node) => {
|
||||
isImportingSelf(context, node, source.value);
|
||||
}, { commonjs: true });
|
||||
},
|
||||
});
|
||||
//# sourceMappingURL=no-self-import.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue