diff --git a/lib/index.js b/lib/index.js index c6e7350..2bb3883 100644 --- a/lib/index.js +++ b/lib/index.js @@ -27,17 +27,18 @@ const createRule = (name, browserstring, description, {fixable = null, schema = return {} } } - if (ts) { - const configName = `typescript-${ts}` + const configName = `typescript-${ts || 'base'}` if (!module.exports.configs[configName]) { + let config = {rules: {}} if (ts === 2016) { - module.exports.configs[configName] = {extends: [`escompat:recommended`], rules: {}} - } else { - module.exports.configs[configName] = {extends: [`escompat:typescript-${ts-1}`], rules: {}} + config.extends = [`escompat:typescript-base`] + } else if (ts) { + config.extends = [`escompat:typescript-${ts-1}`] } + module.exports.configs[configName] = config } - module.exports.configs[configName].rules[`escompat/${name}`] = 'off' - } + module.exports.configs[`typescript-base`].rules[`escompat/${name}`] = 'off' + module.exports.configs[configName].rules[`escompat/${name}`] = 'error' } module.exports = { rules: {}, configs: {} }