Skip to content

Commit 3a00c29

Browse files
committed
Add linting to enforce new Error()
1 parent 787022f commit 3a00c29

File tree

4 files changed

+1346
-12
lines changed

4 files changed

+1346
-12
lines changed

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
# Opt-ins
55
!GOVERNANCE.md
6+
!eslint.config.js
67

78
!/features/*.yml
89
/features/*.yml.dist

eslint.config.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import newWithError from "eslint-plugin-new-with-error";
2+
import tseslint from "typescript-eslint";
3+
4+
export default tseslint.config(tseslint.configs.base, {
5+
plugins: { newWithError },
6+
rules: {
7+
"no-throw-literal": "error",
8+
"newWithError/new-with-error": "error",
9+
},
10+
files: ["**/*.ts"],
11+
});
12+
13+
// TODO: do linting more comprehensively, something like:
14+
// import eslint from "@eslint/js";
15+
// export default tseslint.config(
16+
// eslint.configs.recommendedTypeChecked,
17+
// ...tseslint.configs.recommended,
18+
// {
19+
// plugins: { newWithError },
20+
// rules: {
21+
// "no-throw-literal": "error",
22+
// "newWithError/new-with-error": "error",
23+
// },
24+
// );

0 commit comments

Comments
 (0)