blob: f92ef31e04b5e19e3c993ab44c8675419a1fdecb [file] [log] [blame]
Tim van der Lippe835724b2020-03-10 16:48:02 +00001'use strict';
2
3const fs = require('fs');
4const path = require('path');
5const PACKAGE_NAME = require('./package').name;
6
7const SYMLINK_LOCATION = path.join(__dirname, 'node_modules', PACKAGE_NAME);
8
9// Symlink node_modules/{package name} to this directory
10// so that ESLint resolves this plugin name correctly.
11// (Yes, this plugin still has to hack node_modules to bootstrap itself.)
12if (!fs.existsSync(SYMLINK_LOCATION)) {
13 fs.symlinkSync(__dirname, SYMLINK_LOCATION);
14}
15
Jack Franklin32c8d822021-03-12 11:50:11 +000016require('.').RULES_DIR = [path.resolve('fake-rule-dir-one'), path.resolve('fake-rule-dir-two')];
Tim van der Lippe835724b2020-03-10 16:48:02 +000017
18module.exports = {
19 extends: 'airbnb-base',
20 parserOptions: {
21 sourceType: 'script',
22 },
23 rules: {
24 'global-require': 'off',
25 'import/no-dynamic-require': 'off',
26 'rulesdir/fake-rule': 'error',
Jack Franklin32c8d822021-03-12 11:50:11 +000027 'rulesdir/another-fake-rule': 'error',
Tim van der Lippe835724b2020-03-10 16:48:02 +000028 },
29 plugins: [PACKAGE_NAME],
30};