first commit
This commit is contained in:
30
node_modules/eslint-plugin-import-x/lib/rules/no-webpack-loader-syntax.js
generated
vendored
Normal file
30
node_modules/eslint-plugin-import-x/lib/rules/no-webpack-loader-syntax.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
import { createRule, moduleVisitor } from '../utils/index.js';
|
||||
export default createRule({
|
||||
name: 'no-webpack-loader-syntax',
|
||||
meta: {
|
||||
type: 'problem',
|
||||
docs: {
|
||||
category: 'Static analysis',
|
||||
description: 'Forbid webpack loader syntax in imports.',
|
||||
},
|
||||
schema: [],
|
||||
messages: {
|
||||
unexpected: "Unexpected '!' in '{{name}}'. Do not use import syntax to configure webpack loaders.",
|
||||
},
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
return moduleVisitor((source, node) => {
|
||||
if (source.value?.includes('!')) {
|
||||
context.report({
|
||||
node,
|
||||
messageId: 'unexpected',
|
||||
data: {
|
||||
name: source.value,
|
||||
},
|
||||
});
|
||||
}
|
||||
}, { commonjs: true });
|
||||
},
|
||||
});
|
||||
//# sourceMappingURL=no-webpack-loader-syntax.js.map
|
||||
Reference in New Issue
Block a user