diff --git a/lib/rules/apex/import-apex.js b/lib/rules/apex/import-apex.js new file mode 100644 index 0000000..d96c278 --- /dev/null +++ b/lib/rules/apex/import-apex.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2024, salesforce.com, inc. + * All rights reserved. + * SPDX-License-Identifier: MIT + * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT + */ + +'use strict'; + +// TODO: This sample rule would be removed. +// The import-apex rule definition +module.exports = { + meta: { + type: 'problem', + docs: { + description: + "Importing apex modules can have issue for offline." + }, + fixable: 'code', + schema: [] + }, + create(context) { + return { + ImportDeclaration(node) { + if (node.source.includes('apex')) { + context.report({ + node, + message: + 'Watch out for importing apex!' + }); + } + } + }; + } +};