jsii
Version:
[](https://cdk.dev) [](https://github.com/aws/jsii
37 lines • 2.37 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const configurable_options_1 = __importDefault(require("./configurable-options"));
const deprecated_options_1 = __importDefault(require("./deprecated-options"));
const incompatible_options_1 = __importDefault(require("./incompatible-options"));
const strict_family_options_1 = __importDefault(require("./strict-family-options"));
const validator_1 = require("../validator");
// The public rule set used for the "strict" tsconfig validation setting.
// The goal of this rule set is to ensure a tsconfig that is following best practices for jsii.
// In practice, this is a combination of known incompatible options, known configurable options and additional best practices.
// The rule set also explicitly disallows unknown options.
const strict = new validator_1.RuleSet({
unexpectedFields: validator_1.RuleType.FAIL,
});
// import all options that are configurable
strict.import(configurable_options_1.default);
// import all options that are definitely incompatible
strict.import(incompatible_options_1.default);
// strict family options
strict.import(strict_family_options_1.default);
// Best practice rules
strict.shouldPass('target', validator_1.Match.oneOf('es2022', 'es2023', 'esnext')); // node18+
strict.shouldPass('lib', validator_1.Match.anyOf(validator_1.Match.arrEq(['es2022']), validator_1.Match.arrEq(['es2023']), validator_1.Match.arrEq(['esnext']))); // node18+
strict.shouldPass('module', validator_1.Match.oneOf('node16', 'node18', 'node20', 'nodenext', 'commonjs'));
strict.shouldPass('moduleResolution', validator_1.Match.optional(validator_1.Match.oneOf('node16', 'nodenext', 'bundler')));
strict.shouldPass('skipLibCheck', validator_1.Match.TRUE);
strict.shouldPass('stripInternal', validator_1.Match.optional(validator_1.Match.FALSE));
strict.shouldPass('noEmitOnError', validator_1.Match.TRUE);
strict.shouldPass('declaration', validator_1.Match.TRUE);
strict.shouldPass('noUncheckedSideEffectImports', validator_1.Match.optional(validator_1.Match.TRUE));
// Deprecated ts options that should not be used with jsii
strict.import(deprecated_options_1.default);
exports.default = strict;
//# sourceMappingURL=strict.public.js.map