-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy patheslint.config.mjs
More file actions
91 lines (83 loc) · 2.11 KB
/
Copy patheslint.config.mjs
File metadata and controls
91 lines (83 loc) · 2.11 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
/**
* THIS FILE WAS AUTO-GENERATED.
* PLEASE DO NOT EDIT IT MANUALLY.
* ===============================
* IF YOU'RE COPYING THIS INTO AN ESLINT CONFIG, REMOVE THIS COMMENT BLOCK.
*/
import path from "node:path";
import { includeIgnoreFile } from "@eslint/compat";
import js from "@eslint/js";
import { configs, plugins, rules } from "eslint-config-airbnb-extended";
import { rules as prettierConfigRules } from "eslint-config-prettier";
import prettierPlugin from "eslint-plugin-prettier";
const gitignorePath = path.resolve(".", ".gitignore");
const jsConfig = [
// ESLint Recommended Rules
{
name: "js/config",
...js.configs.recommended,
},
// Stylistic Plugin
plugins.stylistic,
// Import X Plugin
plugins.importX,
// Airbnb Base Recommended Config
...configs.base.recommended,
// Strict Import Config
rules.base.importsStrict,
];
const nodeConfig = [
// Node Plugin
plugins.node,
// Airbnb Node Recommended Config
...configs.node.recommended,
];
const typescriptConfig = [
// TypeScript ESLint Plugin
plugins.typescriptEslint,
// Airbnb Base TypeScript Config
...configs.base.typescript,
];
const prettierConfig = [
// Prettier Plugin
{
name: "prettier/plugin/config",
plugins: {
prettier: prettierPlugin,
},
},
// Prettier Config
{
name: "prettier/config",
rules: {
...prettierConfigRules,
"prettier/prettier": "error",
},
},
];
export default [
// Ignore .gitignore files/folder in eslint
includeIgnoreFile(gitignorePath),
// Javascript Config
...jsConfig,
// Node Config
...nodeConfig,
// TypeScript Config
...typescriptConfig,
// Prettier Config
...prettierConfig,
// Project-specific rule overrides
{
name: "project-overrides",
rules: {
"no-plusplus": "off",
"max-classes-per-file": "off",
"@typescript-eslint/no-unnecessary-parameter-property-assignment": "off",
"n/prefer-global/text-decoder": "off",
"n/prefer-global/text-encoder": "off",
"n/prefer-node-protocol": "off",
"import-x/no-namespace": "off",
"import-x/prefer-default-export": "off",
},
},
];