Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit f6c6040

Browse files
authored
ci: adapt to SE-managed .eslintrc.cjs (#83)
Our old config was almost the same -- only that it also ran eslint on typescript in markdown files, only our README.md. Now, we're importing the SE-managed file, add our overrides, and use that config (.eslintrc.styra.cjs) in CI. Signed-off-by: Stephan Renatus <[email protected]>
1 parent a0069a8 commit f6c6040

File tree

3 files changed

+22
-45
lines changed

3 files changed

+22
-45
lines changed

.eslintrc.js

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

.eslintrc.styra.cjs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* eslint-env node */
2+
const seConfig = require("./.eslintrc.cjs");
3+
module.exports = {
4+
...seConfig,
5+
plugins: ["@typescript-eslint", "markdown"],
6+
overrides: [
7+
{
8+
files: ["**/*.md"],
9+
processor: "markdown/markdown",
10+
},
11+
{
12+
// 1. Target ```ts code blocks in .md files.
13+
files: ["**/*.md/*.ts"],
14+
rules: {
15+
// 2. Disable other rules.
16+
"no-console": "off",
17+
"import/no-unresolved": "off",
18+
},
19+
},
20+
],
21+
};

.github/workflows/pull_request.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ jobs:
1717
with:
1818
node-version: 21
1919
- name: Compile and Test
20-
working-directory: ./
2120
run: |
2221
npm ci
23-
npx eslint --max-warnings=0 src README.md
22+
npx eslint --config=.eslintrc.styra.cjs --max-warnings=0 src README.md
2423
npx prettier . --check
2524
npx typedoc
2625
node --import tsx --test tests/**/*.ts

0 commit comments

Comments
 (0)