-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
70 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
bun i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
bun i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,5 +20,6 @@ | |
"formatter": { | ||
"semicolons": "asNeeded" | ||
} | ||
} | ||
}, | ||
"files": { "ignore": ["index.js"] } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { expect, test } from "bun:test" | ||
import fs from "fs" | ||
import path from "path" | ||
import { spawnSync } from "bun" | ||
|
||
const rootPath = path.resolve(import.meta.dir, "..") | ||
const indexJsPath = path.resolve(rootPath, "index.js") | ||
|
||
test("index.js exists", () => { | ||
expect(fs.existsSync(indexJsPath)).toBeTrue() | ||
}) | ||
|
||
test("index.js is a valid file and can be used by eslint", () => { | ||
// In the root there is a .eslintrc that uses the index.js in the extends. | ||
expect( | ||
spawnSync(["bunx", "eslint", "./scripts/index.ts"], { | ||
cwd: rootPath, | ||
}).success, | ||
).toBeTrue() | ||
}) | ||
|
||
test("index.js has rules from different plugins and includes extra rules", () => { | ||
const rulesToCheck = [ | ||
"no-unsafe-optional-chaining", | ||
"@typescript-eslint/no-extra-non-null-assertion", | ||
"jsx-a11y/html-has-lang", | ||
"react/no-children-prop", | ||
"unicorn/no-instanceof-array", | ||
"simple-import-sort/imports", | ||
] | ||
const indexJsContent = fs.readFileSync(indexJsPath, "utf-8") | ||
|
||
expect(rulesToCheck.every((rule) => indexJsContent.includes(rule))).toBeTrue() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters