-
-
Notifications
You must be signed in to change notification settings - Fork 251
/
eslint.config.js
33 lines (30 loc) · 973 Bytes
/
eslint.config.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
"use strict";
// This is the internal ESLint config for this project itself – it’s not part of
// the eslint-config-prettier npm package. The idea here is to extend some
// sharable config from npm and then include the configs exposed by this package
// as an “eat your own dogfood” test. That feels like a good test, but
// complicates things a little sometimes.
//
// NOTE: Keep this file in sync with `./.eslintrc.js`!
const globals = require("globals");
const base = require("./eslint.base.config");
const index = require(".");
const prettier = require("./prettier");
const eslintrc = require("./.eslintrc");
module.exports = [
...base,
index,
prettier,
{
rules: eslintrc.rules,
},
...eslintrc.overrides.map(({ env = {}, ...override }) => ({
...override,
languageOptions: {
globals: Object.entries(env).reduce(
(acc, [key, enabled]) => (enabled ? { ...acc, ...globals[key] } : acc),
{}
),
},
})),
];