Skip to content

Commit

Permalink
feat!: validate emitDeclarationOnly compiler option
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `emitDeclarationOnly` is now a required compiler option.
Run `plugin-kit verify-package` to get hints about how to apply required changes.
  • Loading branch information
mariuslundgard committed Jan 2, 2023
1 parent 9d753c2 commit d60d46e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/actions/verify/validations.ts
Expand Up @@ -125,6 +125,7 @@ export async function validateTsConfig(
moduleResolution: 'node',
target: 'esnext',
module: 'esnext',
emitDeclarationOnly: true,
esModuleInterop: true,
skipLibCheck: true,
isolatedModules: true,
Expand Down
3 changes: 2 additions & 1 deletion tap-snapshots/test/verify-package.test.ts.test.cjs
Expand Up @@ -125,12 +125,13 @@ To skip this validation add the following to your package.json:
[error]
Recommended tsconfig.json compilerOptions missing:
The following fields had unexpected values: [jsx, moduleResolution, target, module, esModuleInterop, skipLibCheck, isolatedModules, downlevelIteration, declaration, allowSyntheticDefaultImports, rootDir, outDir]
The following fields had unexpected values: [jsx, moduleResolution, target, module, emitDeclarationOnly, esModuleInterop, skipLibCheck, isolatedModules, downlevelIteration, declaration, allowSyntheticDefaultImports, rootDir, outDir]
Expected to find these values:
"jsx": "preserve",
"moduleResolution": "node",
"target": "esnext",
"module": "esnext",
"emitDeclarationOnly": true,
"esModuleInterop": true,
"skipLibCheck": true,
"isolatedModules": true,
Expand Down
3 changes: 2 additions & 1 deletion test/fixtures/inject/valid/tsconfig.json
Expand Up @@ -18,7 +18,8 @@
"skipLibCheck": true,
"isolatedModules": true,
"checkJs": false,
"rootDir": "."
"rootDir": ".",
"emitDeclarationOnly": true
},
"include": ["src/**/*"]
}
3 changes: 2 additions & 1 deletion test/fixtures/verify-package/invalid-eslint/tsconfig.json
Expand Up @@ -17,7 +17,8 @@
"outDir": "dist",
"skipLibCheck": true,
"isolatedModules": true,
"checkJs": false
"checkJs": false,
"emitDeclarationOnly": true
},
"include": ["src/**/*"]
}
3 changes: 2 additions & 1 deletion test/fixtures/verify-package/valid/tsconfig.json
Expand Up @@ -18,7 +18,8 @@
"skipLibCheck": true,
"isolatedModules": true,
"checkJs": false,
"rootDir": "."
"rootDir": ".",
"emitDeclarationOnly": true
},
"include": ["src/**/*"]
}

0 comments on commit d60d46e

Please sign in to comment.