File size: 1,697 Bytes
443c22e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/**
 * @fileoverview Default configuration
 * @author Nicholas C. Zakas
 */

"use strict";

//-----------------------------------------------------------------------------
// Requirements
//-----------------------------------------------------------------------------

const Rules = require("../rules");

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

const sharedDefaultConfig = [
	// intentionally empty config to ensure these files are globbed by default
	{
		files: ["**/*.js", "**/*.mjs"],
	},
	{
		files: ["**/*.cjs"],
		languageOptions: {
			sourceType: "commonjs",
			ecmaVersion: "latest",
		},
	},
];

exports.defaultConfig = Object.freeze([
	{
		plugins: {
			"@": {
				languages: {
					js: require("../languages/js"),
				},

				/*
				 * Because we try to delay loading rules until absolutely
				 * necessary, a proxy allows us to hook into the lazy-loading
				 * aspect of the rules map while still keeping all of the
				 * relevant configuration inside of the config array.
				 */
				rules: new Proxy(
					{},
					{
						get(target, property) {
							return Rules.get(property);
						},

						has(target, property) {
							return Rules.has(property);
						},
					},
				),
			},
		},
		language: "@/js",
		linterOptions: {
			reportUnusedDisableDirectives: 1,
		},
	},

	// default ignores are listed here
	{
		ignores: ["**/node_modules/", ".git/"],
	},

	...sharedDefaultConfig,
]);

exports.defaultRuleTesterConfig = Object.freeze([
	{ files: ["**"] }, // Make sure the default config matches for all files

	...sharedDefaultConfig,
]);