]>
Commit | Line | Data |
---|---|---|
609c276f TL |
1 | /** |
2 | * @fileoverview Default configuration | |
3 | * @author Nicholas C. Zakas | |
4 | */ | |
5 | ||
6 | "use strict"; | |
7 | ||
8 | //----------------------------------------------------------------------------- | |
9 | // Requirements | |
10 | //----------------------------------------------------------------------------- | |
11 | ||
12 | const Rules = require("../rules"); | |
13 | ||
14 | //----------------------------------------------------------------------------- | |
15 | // Helpers | |
16 | //----------------------------------------------------------------------------- | |
17 | ||
609c276f TL |
18 | exports.defaultConfig = [ |
19 | { | |
20 | plugins: { | |
21 | "@": { | |
22 | parsers: { | |
23 | espree: require("espree") | |
24 | }, | |
25 | ||
26 | /* | |
27 | * Because we try to delay loading rules until absolutely | |
34eeec05 | 28 | * necessary, a proxy allows us to hook into the lazy-loading |
609c276f TL |
29 | * aspect of the rules map while still keeping all of the |
30 | * relevant configuration inside of the config array. | |
31 | */ | |
32 | rules: new Proxy({}, { | |
33 | get(target, property) { | |
34 | return Rules.get(property); | |
35 | }, | |
36 | ||
37 | has(target, property) { | |
38 | return Rules.has(property); | |
39 | } | |
40 | }) | |
41 | } | |
42 | }, | |
609c276f | 43 | languageOptions: { |
34eeec05 | 44 | sourceType: "module", |
8f9d1d4d | 45 | ecmaVersion: "latest", |
34eeec05 TL |
46 | parser: "@/espree", |
47 | parserOptions: {} | |
48 | } | |
49 | }, | |
8f9d1d4d DC |
50 | |
51 | // default ignores are listed here | |
52 | { | |
53 | ignores: [ | |
54 | "**/node_modules/**", | |
55 | ".git/**" | |
56 | ] | |
57 | }, | |
58 | ||
59 | // intentionally empty config to ensure these files are globbed by default | |
60 | { | |
61 | files: ["**/*.js", "**/*.mjs"] | |
62 | }, | |
34eeec05 TL |
63 | { |
64 | files: ["**/*.cjs"], | |
65 | languageOptions: { | |
8f9d1d4d DC |
66 | sourceType: "commonjs", |
67 | ecmaVersion: "latest" | |
609c276f TL |
68 | } |
69 | } | |
70 | ]; |