Skip to content

Commit 53a2826

Browse files
authored
Merge pull request #425 from evolvedbinary/monorepo/eslint
Update tsconfig and eslint to match the Monorepo setup
2 parents bee1174 + 8561c6f commit 53a2826

12 files changed

Lines changed: 100 additions & 27 deletions

eslint.config.mts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import tseslint from "typescript-eslint";
2121
import { defineConfig } from "eslint/config";
2222
import notice from "eslint-plugin-notice";
2323
import tsdoc from "eslint-plugin-tsdoc";
24+
import path from "path";
2425

2526

2627
export default defineConfig([
@@ -62,7 +63,10 @@ export default defineConfig([
6263
}
6364
],
6465
// notice
65-
"notice/notice": ["error", { templateFile: "./config/notice.js" }],
66+
"notice/notice": [
67+
"error",
68+
{ templateFile: path.resolve(__dirname, "./config/notice.js") }
69+
],
6670

6771
// tsdoc
6872
"tsdoc/syntax": "warn"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"test": "mocha",
2121
"test:watch": "mocha -w",
2222
"generate-docs": "yarn workspaces foreach --parallel --recursive --from '@evolvedbinary/lwdita-*' run docs",
23-
"lint": "eslint",
23+
"lint": "yarn workspaces foreach --recursive --from '@evolvedbinary/lwdita-*' run lint",
2424
"coverage": "rimraf coverage && nyc yarn mocha",
2525
"coveralls": "nyc --reporter=text-lcov report | coveralls"
2626
},
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*!
2+
Copyright (C) 2020 Evolved Binary
3+
4+
This program is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU Affero General Public License as
6+
published by the Free Software Foundation, either version 3 of the
7+
License, or (at your option) any later version.
8+
9+
This program is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU Affero General Public License for more details.
13+
14+
You should have received a copy of the GNU Affero General Public License
15+
along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
18+
import rootConfig from "../../eslint.config.mjs";
19+
import { defineConfig } from "eslint/config";
20+
import globals from "globals";
21+
22+
export default defineConfig([
23+
...rootConfig,
24+
{
25+
files: ["src/**/*.ts"],
26+
languageOptions: {
27+
globals: { ...globals.browser }
28+
}
29+
},
30+
]);

packages/lwdita-ast/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
},
1010
"scripts": {
1111
"build": "tsc",
12-
"clean": "rimraf dist",
12+
"clean": "rimraf dist tsconfig.tsbuildinfo",
1313
"prepack": "yarn run build",
14-
"docs": "typedoc --options typedoc.config.mjs --entryPoints src/index.ts --out dist/doc"
14+
"docs": "typedoc --options typedoc.config.mjs --entryPoints src/index.ts --out dist/doc",
15+
"lint": "eslint"
1516
},
1617
"keywords": [
1718
"LwDITA",
@@ -30,6 +31,7 @@
3031
"url": "https://github.com/evolvedbinary/lwdita/issues"
3132
},
3233
"devDependencies": {
34+
"eslint": "^9.38.0",
3335
"rimraf": "^6.1.0",
3436
"typedoc": "^0.28.14",
3537
"typescript": "5.9.3"

packages/lwdita-ast/tsconfig.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
"compilerOptions": {
44
"rootDir": "src",
55
"outDir": "dist",
6+
"composite": true,
7+
"declaration": true,
8+
"declarationMap": true,
69
},
7-
8-
"exclude": [
9-
"test/**/*",
10-
"node_modules",
11-
]
10+
"include": ["src/**/*"]
1211
}

packages/lwdita-ast/typedoc.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
1717

1818
import { OptionDefaults } from "typedoc";
1919

20-
/** @type {Partial<import('typedoc').TypeDocOptions>} */
2120
const config = {
2221
tsconfig: "./tsconfig.json",
2322
modifierTags: [...OptionDefaults.modifierTags, "@decorator"],
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*!
2+
Copyright (C) 2020 Evolved Binary
3+
4+
This program is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU Affero General Public License as
6+
published by the Free Software Foundation, either version 3 of the
7+
License, or (at your option) any later version.
8+
9+
This program is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU Affero General Public License for more details.
13+
14+
You should have received a copy of the GNU Affero General Public License
15+
along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
18+
import rootConfig from "../../eslint.config.mjs";
19+
import { defineConfig } from "eslint/config";
20+
import globals from "globals";
21+
22+
export default defineConfig([
23+
...rootConfig,
24+
{
25+
files: ["src/**/*.ts"],
26+
languageOptions: {
27+
globals: { ...globals.browser }
28+
}
29+
},
30+
]);

packages/lwdita-xdita/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
},
1010
"scripts": {
1111
"build": "tsc",
12-
"clean": "rimraf dist",
12+
"clean": "rimraf dist tsconfig.tsbuildinfo",
1313
"prepack": "yarn run build",
1414
"docs": "typedoc --options typedoc.config.mjs --entryPoints src/index.ts --out dist/doc",
15-
"example": "ts-node ./example.ts"
15+
"example": "ts-node ./example.ts",
16+
"lint": "eslint"
1617
},
1718
"keywords": [
1819
"LwDITA",
@@ -39,6 +40,7 @@
3940
],
4041
"devDependencies": {
4142
"@types/node": "^24.10.1",
43+
"eslint": "^9.38.0",
4244
"rimraf": "^6.1.0",
4345
"ts-node": "^10.9.2",
4446
"typedoc": "^0.28.14",
Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
{
2-
"extends": "../../tsconfig.json",
3-
"compilerOptions": {
4-
"rootDir": "src",
5-
"outDir": "dist",
6-
},
7-
"exclude": [
8-
"test/**/*",
9-
"node_modules",
10-
"example.ts"
11-
]
12-
}
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"rootDir": "src",
5+
"outDir": "dist",
6+
"composite": true,
7+
"declaration": true,
8+
"declarationMap": true,
9+
},
10+
"include": [
11+
"src/**/*"
12+
],
13+
"references": [
14+
{ "path": "../lwdita-ast" }
15+
]
16+
}

packages/lwdita-xdita/typedoc.config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
1717

1818
import { OptionDefaults } from "typedoc";
1919

20-
/** @type {Partial<import('typedoc').TypeDocOptions>} */
2120
const config = {
2221
tsconfig: "./tsconfig.json",
2322
modifierTags: [...OptionDefaults.modifierTags, "@decorator"],

0 commit comments

Comments
 (0)