forked from aladdin-add/eslint-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
48 lines (44 loc) · 1.2 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"use strict";
const _module = require("module");
const path = require("path");
const findPath = _module._findPath;
const hacks = [
"eslint-plugin-autofix",
"eslint-plugin-no-autofix"
];
_module._findPath = (request, paths, isMain) => {
const r = findPath(request, paths, isMain);
if (!r && hacks.includes(request)) {
try {
return require.resolve(`./node_modules/${request}`);
// Keep the variable in place to ensure that ESLint started by older Node.js
// versions work as expected.
// eslint-disable-next-line no-unused-vars
} catch (e) {
return path.join(__dirname, `./packages/${request.slice("eslint-plugin-".length)}`);
}
}
return r;
};
module.exports = {
extends: [
"eslint-config-eslint",
"plugin:eslint-plugin/recommended"
],
plugins: [
"eslint-plugin",
"eslint-plugin-autofix",
"eslint-plugin-no-autofix"
],
rules: {
"no-autofix/eslint-plugin/test-case-shorthand-strings": "error"
},
overrides: [
{
files: ["packages/*/tests/**/*"],
env: {
mocha: true
}
}
]
};