blob: b70f5cbcfef711363af9d9e847cd8ba1c9b50a13 [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
16require('.').RULES_DIR = path.resolve('tests');
17
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',
27 },
28 plugins: [PACKAGE_NAME],
29};