Skip to content

Commit

Permalink
feat(ts): add tsconfig.json order (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
Debbl committed Sep 14, 2023
1 parent 0984290 commit c3eb365
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 1 deletion.
119 changes: 119 additions & 0 deletions packages/eslint-config-ts/index.js
Expand Up @@ -60,6 +60,125 @@ module.exports = {
'@typescript-eslint/unbound-method': 'off',
'jest/unbound-method': 'error',
},
}, {
files: ['tsconfig.json', 'tsconfig.*.json'],
parser: 'jsonc-eslint-parser',
rules: {
'jsonc/sort-keys': [
'error',
{
pathPattern: '^$',
order: [
'extends',
'compilerOptions',
'references',
'files',
'include',
'exclude',
],
},
{
pathPattern: '^compilerOptions$',
order: [
/* Projects */
'incremental',
'composite',
'tsBuildInfoFile',
'disableSourceOfProjectReferenceRedirect',
'disableSolutionSearching',
'disableReferencedProjectLoad',
/* Language and Environment */
'target',
'lib',
'jsx',
'experimentalDecorators',
'emitDecoratorMetadata',
'jsxFactory',
'jsxFragmentFactory',
'jsxImportSource',
'reactNamespace',
'noLib',
'useDefineForClassFields',
'moduleDetection',
/* Modules */
'module',
'rootDirs',
'moduleResolution',
'baseUrl',
'paths',
'typeRoots',
'types',
'allowUmdGlobalAccess',
'moduleSuffixes',
'allowImportingTsExtensions',
'resolvePackageJsonExports',
'resolvePackageJsonImports',
'customConditions',
'resolveJsonModule',
'allowArbitraryExtensions',
'noResolve',
/* JavaScript Support */
'allowJs',
'checkJs',
'maxNodeModuleJsDepth',
/* Emit */
'declaration',
'declarationMap',
'emitDeclarationOnly',
'sourceMap',
'inlineSourceMap',
'outFile',
'outDir',
'removeComments',
'noEmit',
'importHelpers',
'importsNotUsedAsValues',
'downlevelIteration',
'sourceRoot',
'mapRoot',
'inlineSources',
'emitBOM',
'newLine',
'stripInternal',
'noEmitHelpers',
'noEmitOnError',
'preserveConstEnums',
'declarationDir',
'preserveValueImports',
/* Interop Constraints */
'isolatedModules',
'verbatimModuleSyntax',
'allowSyntheticDefaultImports',
'esModuleInterop',
'preserveSymlinks',
'forceConsistentCasingInFileNames',
/* Type Checking */
'strict',
'noImplicitAny',
'strictNullChecks',
'strictFunctionTypes',
'strictBindCallApply',
'strictPropertyInitialization',
'noImplicitThis',
'useUnknownInCatchVariables',
'alwaysStrict',
'noUnusedLocals',
'noUnusedParameters',
'exactOptionalPropertyTypes',
'noImplicitReturns',
'noFallthroughCasesInSwitch',
'noUncheckedIndexedAccess',
'noImplicitOverride',
'noPropertyAccessFromIndexSignature',
'allowUnusedLabels',
'allowUnreachableCode',
/* Completeness */
'skipDefaultLibCheck',
'skipLibCheck',
],
},
],
},
}],
),
rules: {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
@@ -1,9 +1,9 @@
{
"compilerOptions": {
"baseUrl": ".",
"target": "es2020",
"module": "es2020",
"moduleResolution": "Bundler",
"baseUrl": ".",
"esModuleInterop": true
},
"include": [
Expand Down

0 comments on commit c3eb365

Please sign in to comment.