We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8d86f0f commit f1e21bfCopy full SHA for f1e21bf
.github/workflows/CI.yml
@@ -35,15 +35,15 @@ jobs:
35
- name: Install dependencies
36
run: pnpm install
37
38
- # - name: Format ✨
39
- # run: pnpm run test.format
+ - name: Format ✨
+ run: pnpm run test.format
40
41
- name: Lint ✨
42
run: pnpm run test.lint
43
44
- # - name: Tests
45
- # run: |
46
- # pnpm test
+ - name: Tests
+ run: |
+ pnpm test
47
48
# Release:
49
# needs: [Test]
.gitignore
@@ -16,3 +16,5 @@ spec/fixtures/atom-community
16
spec/fixtures/atom-minimap
17
spec/fixtures/aminya
18
spec/fixtures/steelbrain
19
+
20
+*.tar.gz
package.json
@@ -14,10 +14,10 @@
14
"*.js"
15
],
"scripts": {
- "dev": "tsc --pretty --watch",
"build": "tsc --pretty",
"bump": "ncu -u -x coffeescript,execa,read-pkg-up,make-synchronous && pnpm update && pnpm dedupe",
"clean": "shx rm -rf ./spec/fixtures/ ./dist",
+ "dev": "tsc --pretty --watch",
21
"format": "prettier --write .",
22
"lint": "eslint ./ --ignore dist --fix",
23
"prepare": "pnpm run build",
spec/test.cjs
@@ -45,42 +45,48 @@ async function testLint(packedPkg, testRepo, isWorkspace = false, isSilent = fal
throw e
}
- const result = await execa.command("eslint .", { cwd: distFolder, stdout: !isSilent ? "inherit" : "pipe" })
+ const result = await execa.command("eslint . --cache", { cwd: distFolder, stdout: !isSilent ? "inherit" : "pipe" })
if (result.failed) {
50
throw new Error("An error happened")
51
52
53
54
/** Main entry */
55
-;(async function main() {
+async function main() {
56
const root = resolve(dirname(__dirname))
57
const packedPkg = join(root, `${pkg.name}-${pkg.version}.tgz`)
58
rm("-rf", packedPkg)
59
await execa.command("pnpm pack", { cwd: root })
60
61
const errs = []
62
- for (const testRepo of testRepos) {
63
- try {
64
- // We want to observe the output in order, so we await inside loop
65
- await testLint(packedPkg, testRepo, false) // eslint-disable-line no-await-in-loop
66
- } catch (err) {
67
- console.error(err)
68
- errs.push(err)
69
- }
70
+ await Promise.all([
+ ...testRepos.map(async (testRepo) => {
+ try {
+ await testLint(packedPkg, testRepo, false)
+ } catch (err) {
+ console.error(err)
+ errs.push(err)
+ }
+ }),
71
+ ...testWorkspaces.map(async (testWorkspace) => {
72
73
+ await testLint(packedPkg, testWorkspace, true, true)
74
75
76
77
78
79
+ ])
80
- for (const testWorkspace of testWorkspaces) {
- await testLint(packedPkg, testWorkspace, true, true) // eslint-disable-line no-await-in-loop
81
if (errs.length !== 0) {
82
83
throw new Error(`${errs.length} packages failed the tests. See the above.`)
84
85
86
-})()
87
+}
88
89
+main().catch((err) => {
90
91
+ process.exit(1)
92
+})
src/index-react.cts
@@ -2,22 +2,22 @@ import type { Linter } from "eslint"
2
import base from "./index.cjs"
3
import { tsConfigs } from "./typescript.cjs"
4
import reactPlugin from "eslint-plugin-react"
5
-import globals from "globals";
+import globals from "globals"
6
7
const reactTypeScript: Linter.Config = {
8
...tsConfigs,
9
- ...reactPlugin.configs.flat.recommended
10
-};
+ ...reactPlugin.configs.flat.recommended,
11
12
const nonStrictConfig: Linter.Config[] = [
13
...base,
// JavaScript:
{
- files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'],
+ files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"],
...reactPlugin.configs.flat.recommended,
},
languageOptions: {
globals: {
...globals.serviceworker,
src/index-solid.cts
@@ -5,8 +5,8 @@ import solid from "eslint-plugin-solid"
const solidTypeScript: Linter.Config = {
...tsConfig,
- ...solid.configs["flat/typescript"]
+ ...solid.configs["flat/typescript"],
src/typescript.cts
@@ -148,7 +148,7 @@ export const tsConfig: Linter.Config = {
148
...pluginImportTypeScriptRulesExtra,
149
...importPlugin.configs.recommended.rules,
150
151
152
153
export const tsConfigs: Linter.Config[] = [
154
// TypeScript files
0 commit comments