forked from
jollywhoppers.com/witchsky.app
Bluesky app fork with some witchin' additions 馃挮
1const BANNED_IMPORTS = [
2 '@fortawesome/free-regular-svg-icons',
3 '@fortawesome/free-solid-svg-icons',
4]
5
6/** @type {import('eslint').Rule.RuleModule} */
7module.exports = {
8 meta: {
9 type: 'suggestion',
10 docs: {
11 description: 'Prevent importing entire icon packages',
12 },
13 schema: [],
14 },
15 create(context) {
16 return {
17 ImportDeclaration(node) {
18 const source = node.source
19 if (typeof source.value !== 'string') {
20 return
21 }
22 if (BANNED_IMPORTS.includes(source.value)) {
23 context.report({
24 node,
25 message:
26 'Import the specific thing you want instead of the entire package',
27 })
28 }
29 },
30 }
31 },
32}