Skip to content

Commit 8e14792

Browse files
authored
Merge pull request #2374 from github/aeisenberg/eslint
Migrate to `eslint.config.mjs`
2 parents c2585ec + 455bd98 commit 8e14792

File tree

91 files changed

+22220
-606
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+22220
-606
lines changed

.eslintrc.json

Lines changed: 0 additions & 71 deletions
This file was deleted.

eslint.config.mjs

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
// Automatically generated by running npx @eslint/migrate-config .eslintrc.json
2+
3+
import path from "node:path";
4+
import { fileURLToPath } from "node:url";
5+
6+
import { fixupConfigRules, fixupPluginRules } from "@eslint/compat";
7+
import { FlatCompat } from "@eslint/eslintrc";
8+
import js from "@eslint/js";
9+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
10+
import tsParser from "@typescript-eslint/parser";
11+
import filenames from "eslint-plugin-filenames";
12+
import github from "eslint-plugin-github";
13+
import _import from "eslint-plugin-import";
14+
import noAsyncForeach from "eslint-plugin-no-async-foreach";
15+
import globals from "globals";
16+
17+
const __filename = fileURLToPath(import.meta.url);
18+
const __dirname = path.dirname(__filename);
19+
const compat = new FlatCompat({
20+
baseDirectory: __dirname,
21+
recommendedConfig: js.configs.recommended,
22+
allConfig: js.configs.all,
23+
});
24+
25+
export default [
26+
{
27+
ignores: [
28+
"**/webpack.config.js",
29+
"lib/**/*",
30+
"src/testdata/**/*",
31+
"tests/**/*",
32+
"eslint.config.mjs",
33+
".github/**/*",
34+
],
35+
},
36+
...fixupConfigRules(
37+
compat.extends(
38+
"eslint:recommended",
39+
"plugin:@typescript-eslint/recommended",
40+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
41+
"plugin:github/recommended",
42+
"plugin:github/typescript",
43+
"plugin:import/typescript",
44+
),
45+
),
46+
{
47+
plugins: {
48+
"@typescript-eslint": fixupPluginRules(typescriptEslint),
49+
filenames: fixupPluginRules(filenames),
50+
github: fixupPluginRules(github),
51+
import: fixupPluginRules(_import),
52+
"no-async-foreach": noAsyncForeach,
53+
},
54+
55+
languageOptions: {
56+
parser: tsParser,
57+
ecmaVersion: 5,
58+
sourceType: "module",
59+
60+
globals: {
61+
...globals.node,
62+
},
63+
64+
parserOptions: {
65+
project: "./tsconfig.json",
66+
},
67+
},
68+
69+
settings: {
70+
"import/resolver": {
71+
node: {
72+
moduleDirectory: ["node_modules", "src"],
73+
},
74+
75+
typescript: {},
76+
},
77+
"import/ignore": ["sinon", "uuid", "@octokit/plugin-retry"],
78+
},
79+
80+
rules: {
81+
"filenames/match-regex": ["error", "^[a-z0-9-]+(\\.test)?$"],
82+
"i18n-text/no-en": "off",
83+
84+
"import/extensions": [
85+
"error",
86+
{
87+
json: {},
88+
},
89+
],
90+
91+
"import/no-amd": "error",
92+
"import/no-commonjs": "error",
93+
"import/no-cycle": "error",
94+
"import/no-dynamic-require": "error",
95+
96+
"import/no-extraneous-dependencies": [
97+
"error",
98+
{
99+
devDependencies: true,
100+
},
101+
],
102+
103+
"import/no-namespace": "off",
104+
"import/no-unresolved": "error",
105+
"import/no-webpack-loader-syntax": "error",
106+
107+
"import/order": [
108+
"error",
109+
{
110+
alphabetize: {
111+
order: "asc",
112+
},
113+
114+
"newlines-between": "always",
115+
},
116+
],
117+
118+
"max-len": [
119+
"error",
120+
{
121+
code: 120,
122+
ignoreUrls: true,
123+
ignoreStrings: true,
124+
ignoreTemplateLiterals: true,
125+
},
126+
],
127+
128+
"no-async-foreach/no-async-foreach": "error",
129+
"no-sequences": "error",
130+
"no-shadow": "off",
131+
"@typescript-eslint/no-shadow": "error",
132+
"one-var": ["error", "never"],
133+
},
134+
},
135+
{
136+
files: ["**/*.ts", "**/*.js"],
137+
138+
rules: {
139+
"@typescript-eslint/no-explicit-any": "off",
140+
"@typescript-eslint/no-unsafe-assignment": "off",
141+
"@typescript-eslint/no-unsafe-member-access": "off",
142+
"@typescript-eslint/no-var-requires": "off",
143+
"@typescript-eslint/prefer-regexp-exec": "off",
144+
"@typescript-eslint/require-await": "off",
145+
"@typescript-eslint/restrict-template-expressions": "off",
146+
"func-style": "off",
147+
},
148+
},
149+
];

node_modules/.package-lock.json

Lines changed: 95 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy