Skip to content

Commit 71cd580

Browse files
committed
More CI
1 parent a246757 commit 71cd580

File tree

17 files changed

+295
-193
lines changed

17 files changed

+295
-193
lines changed

.eslintrc.json

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

eslint.config.mjs

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
import {
2+
fixupConfigRules,
3+
fixupPluginRules,
4+
fixupConfigRules,
5+
} from "@eslint/compat";
6+
import typescriptEslint from "@typescript-eslint/eslint-plugin";
7+
import unusedImports from "eslint-plugin-unused-imports";
8+
import _import from "eslint-plugin-import";
9+
import unicorn from "eslint-plugin-unicorn";
10+
import mocha from "eslint-plugin-mocha";
11+
import tsParser from "@typescript-eslint/parser";
12+
import path from "node:path";
13+
import { fileURLToPath } from "node:url";
14+
import js from "@eslint/js";
15+
import { FlatCompat } from "@eslint/eslintrc";
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+
"**/generated/**/*",
29+
"**/out/**/*",
30+
"**/vendor/**/*.js",
31+
"**/vendor/**/*.ts",
32+
"data/playground/**/*",
33+
],
34+
},
35+
...fixupConfigRules(
36+
compat.extends(
37+
"eslint:recommended",
38+
"plugin:@typescript-eslint/recommended",
39+
"plugin:import/typescript",
40+
"prettier",
41+
),
42+
),
43+
{
44+
plugins: {
45+
"@typescript-eslint": fixupPluginRules(typescriptEslint),
46+
"unused-imports": unusedImports,
47+
import: fixupPluginRules(_import),
48+
unicorn,
49+
mocha,
50+
},
51+
52+
languageOptions: {
53+
parser: tsParser,
54+
ecmaVersion: 6,
55+
sourceType: "module",
56+
57+
parserOptions: {
58+
project: true,
59+
},
60+
},
61+
62+
settings: {
63+
"import/resolver": {
64+
typescript: {
65+
alwaysTryTypes: true,
66+
project: ["tsconfig.json", "packages/*/tsconfig.json"],
67+
},
68+
},
69+
},
70+
71+
rules: {
72+
"import/no-relative-packages": "error",
73+
"@typescript-eslint/consistent-type-imports": "error",
74+
75+
"@typescript-eslint/consistent-type-assertions": [
76+
"error",
77+
{
78+
assertionStyle: "as",
79+
},
80+
],
81+
82+
"@typescript-eslint/naming-convention": [
83+
"error",
84+
{
85+
selector: ["objectLiteralProperty"],
86+
format: ["camelCase"],
87+
88+
filter: {
89+
regex: "[.]",
90+
match: false,
91+
},
92+
},
93+
],
94+
95+
"@typescript-eslint/no-floating-promises": "error",
96+
"@typescript-eslint/no-explicit-any": "off",
97+
"@typescript-eslint/no-inferrable-types": "off",
98+
"@typescript-eslint/no-non-null-assertion": "off",
99+
"unused-imports/no-unused-imports": "error",
100+
101+
"@typescript-eslint/no-unused-vars": [
102+
"error",
103+
{
104+
argsIgnorePattern: "^_",
105+
varsIgnorePattern: "^_",
106+
caughtErrorsIgnorePattern: "^_",
107+
ignoreRestSiblings: true,
108+
},
109+
],
110+
111+
curly: "error",
112+
113+
eqeqeq: [
114+
"error",
115+
"always",
116+
{
117+
null: "never",
118+
},
119+
],
120+
121+
"no-constant-condition": [
122+
"error",
123+
{
124+
checkLoops: false,
125+
},
126+
],
127+
128+
"no-restricted-syntax": [
129+
"error",
130+
"MemberExpression[object.property.name='constructor'][property.name='name']",
131+
],
132+
133+
"no-throw-literal": "error",
134+
semi: "off",
135+
"unicorn/prefer-module": "error",
136+
"mocha/no-skipped-tests": "error",
137+
"mocha/no-exclusive-tests": "error",
138+
},
139+
},
140+
{
141+
files: ["**/*.tsx"],
142+
143+
rules: {
144+
"@typescript-eslint/naming-convention": [
145+
"error",
146+
{
147+
selector: ["function"],
148+
format: ["PascalCase", "camelCase"],
149+
},
150+
],
151+
},
152+
},
153+
...fixupConfigRules(
154+
compat.extends("plugin:@typescript-eslint/disable-type-checked"),
155+
).map((config) => ({
156+
...config,
157+
158+
files: [
159+
"**/jest.config.ts",
160+
"**/docusaurus.config.mts",
161+
"**/mdx-components.tsx",
162+
"typings/**",
163+
],
164+
})),
165+
];

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
"author": "",
2929
"license": "MIT",
3030
"devDependencies": {
31+
"@eslint/compat": "1.2.7",
32+
"@eslint/eslintrc": "3.3.0",
33+
"@eslint/js": "9.22.0",
3134
"@pnpm/meta-updater": "2.0.5",
3235
"@types/node": "20.16.0",
3336
"@typescript-eslint/eslint-plugin": "^8.26.1",

packages/common/.eslintrc.json

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

packages/common/eslint.config.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export default [
2+
{
3+
files: ["**/*.ts"],
4+
ignores: ["**/*.test.ts"],
5+
6+
rules: {
7+
"import/no-nodejs-modules": "error",
8+
},
9+
},
10+
];

packages/common/src/types/command/.eslintrc.json

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
export default [
2+
{
3+
rules: {
4+
"@typescript-eslint/no-restricted-imports": [
5+
"error",
6+
{
7+
patterns: [
8+
{
9+
group: ["@cursorless/*", "../*"],
10+
message: "API types shouldn't have any dependencies",
11+
},
12+
],
13+
14+
paths: [
15+
{
16+
name: "@*",
17+
message: "API types shouldn't have any dependencies",
18+
},
19+
],
20+
},
21+
],
22+
},
23+
},
24+
];

packages/cursorless-engine/.eslintrc.json

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
export default [
2+
{
3+
files: ["**/*.ts"],
4+
ignores: ["src/scripts/**", "src/testUtil/**", "**/*.test.ts"],
5+
6+
rules: {
7+
"import/no-nodejs-modules": "error",
8+
},
9+
},
10+
];

packages/cursorless-engine/src/processTargets/.eslintrc.json

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

0 commit comments

Comments
 (0)