Skip to content

Commit

Permalink
Pull request #823: fix linter highlighting in vscode
Browse files Browse the repository at this point in the history
Merge in ADGUARD-FILTERS/tsurlfilter from fix/linter-highlighting to master

Squashed commit of the following:

commit 43ebe22
Author: Vladimir Zhelvis <[email protected]>
Date:   Wed Mar 27 12:55:45 2024 +0300

    fix linter highlighting in vscode
  • Loading branch information
zhelvis committed Mar 27, 2024
1 parent 9726e6b commit eb21b0b
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 36 deletions.
2 changes: 1 addition & 1 deletion packages/tsurlfilter/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: path.join(__dirname),
project: 'tsconfig.eslint.json',
project: 'tsconfig.json',
},
plugins: [
'import',
Expand Down
3 changes: 2 additions & 1 deletion packages/tsurlfilter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"prebuild": "rimraf dist && pnpm build:types",
"build": "pnpm prebuild && rollup -c rollup.config.ts && pnpm postbuild",
"postbuild": "node tasks/build-txt",
"build:types": "tsc --declaration --emitDeclarationOnly --outdir dist/types",
"build:types": "tsc --project tsconfig.build.json --declaration --emitDeclarationOnly --outdir dist/types",
"docs": "typedoc src --out docs",
"start": "rollup -c rollup.config.ts -w",
"test": "jest --coverage",
Expand Down Expand Up @@ -107,6 +107,7 @@
"@swc/jest": "0.2.36",
"@types/ip6addr": "0.2.3",
"@types/jest": "29.5.3",
"@types/lodash": "^4.17.0",
"@types/netmask": "1.0.30",
"@types/node": "18.7.1",
"@types/punycode": "2.1.0",
Expand Down
8 changes: 6 additions & 2 deletions packages/tsurlfilter/rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ const commonConfig = {
json(),

// Compile TypeScript files
typescript(),
typescript({
tsconfig: 'tsconfig.build.json',
}),

// Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs)
commonjs({
Expand Down Expand Up @@ -135,7 +137,9 @@ const cliConfig = {
json(),

// Compile TypeScript files
typescript(),
typescript({
tsconfig: 'tsconfig.build.json',
}),

// Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs)
commonjs({
Expand Down
19 changes: 19 additions & 0 deletions packages/tsurlfilter/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"moduleResolution": "node",
"target": "es5",
"module":"es2015",
"lib": ["esnext", "dom"],
"strict": true,
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"typeRoots": [
"./types",
"node_modules/@types",
"../../node_modules/@types"
]
}
}
7 changes: 7 additions & 0 deletions packages/tsurlfilter/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.base.json",
"include": [
"src/**/*.ts",
"cli/**/*.ts",
],
}
12 changes: 0 additions & 12 deletions packages/tsurlfilter/tsconfig.eslint.json

This file was deleted.

27 changes: 8 additions & 19 deletions packages/tsurlfilter/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
{
"compilerOptions": {
"moduleResolution": "node",
"target": "es5",
"module":"es2015",
"lib": ["esnext", "dom"],
"strict": true,
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"typeRoots": [
"./types",
"node_modules/@types",
"../../node_modules/@types"
]
},
"extends": "./tsconfig.base.json",
"include": [
"src",
"cli"
"src/**/*.ts",
"cli/**/*.ts",
"test/**/*.ts",
".eslintrc.js",
"rollup.config.ts",
"jest.config.ts",
"tasks/generate-examples.ts"
],
"ts-node": {
"swc": true,
Expand Down
5 changes: 4 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eb21b0b

Please sign in to comment.