Skip to content

Commit 818bcf2

Browse files
chore: configure lint and prettier
1 parent 08130b3 commit 818bcf2

File tree

7 files changed

+1146
-28
lines changed

7 files changed

+1146
-28
lines changed

.github/workflows/common-build.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,28 @@ env:
1111
node_version: 20
1212

1313
jobs:
14+
lint:
15+
name: lint & typecheck
16+
runs-on: ubuntu-latest
17+
environment: ${{ inputs.environment }}
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: ${{ env.node_version }}
23+
cache: "npm"
24+
- name: Install NPM dependencies
25+
run: npm ci
26+
- name: Typecheck
27+
run: |
28+
npm run typecheck
29+
- name: Lint
30+
run: |
31+
npm run lint
32+
1433
build:
34+
needs:
35+
- lint
1536
runs-on: ubuntu-latest
1637
concurrency:
1738
group: build

.github/workflows/pull-request.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ permissions:
1010
contents: write
1111

1212
jobs:
13-
build-and-test:
14-
uses: ./.github/workflows/common.yml
13+
build:
14+
uses: ./.github/workflows/common-build.yml
1515
secrets: inherit
16+
17+
test:
18+
uses: ./.github/workflows/common-test.yml
19+
secrets: inherit
20+
needs: build
21+
with:
22+
mode: build
23+
testMonorepo: false

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm run typecheck && npm run prettier && npm run lint

eslint.config.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import globals from "globals";
2+
import pluginJs from "@eslint/js";
3+
import tseslint from "typescript-eslint";
4+
import pluginPrettier from "eslint-plugin-prettier";
5+
import prettierConfig from "eslint-config-prettier";
6+
7+
export default [
8+
{ files: ["**/*.{js,mjs,cjs,ts}"] },
9+
{
10+
ignores: [
11+
"**/dist/**",
12+
"**/cdk.out/**",
13+
"**/.lldebugger/**",
14+
"**/.aws-sam/**",
15+
"src/extension/aws/*.js",
16+
],
17+
},
18+
{
19+
languageOptions: {
20+
globals: globals.node,
21+
parser: "@typescript-eslint/parser",
22+
parserOptions: {
23+
project: "./tsconfig.json",
24+
},
25+
},
26+
},
27+
pluginJs.configs.recommended,
28+
...tseslint.configs.recommended,
29+
{
30+
plugins: {
31+
prettier: pluginPrettier,
32+
},
33+
rules: {
34+
...pluginPrettier.configs.recommended.rules,
35+
"@typescript-eslint/no-floating-promises": "error",
36+
"@typescript-eslint/no-explicit-any": "off",
37+
"@typescript-eslint/no-require-imports": "off",
38+
"@typescript-eslint/ban-ts-comment": "off",
39+
},
40+
},
41+
prettierConfig,
42+
];

0 commit comments

Comments
 (0)