Skip to content

Commit c3eb365

Browse files
authoredSep 14, 2023
feat(ts): add tsconfig.json order (#243)
1 parent 0984290 commit c3eb365

File tree

2 files changed

+120
-1
lines changed

2 files changed

+120
-1
lines changed
 

‎packages/eslint-config-ts/index.js

+119
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,125 @@ module.exports = {
6060
'@typescript-eslint/unbound-method': 'off',
6161
'jest/unbound-method': 'error',
6262
},
63+
}, {
64+
files: ['tsconfig.json', 'tsconfig.*.json'],
65+
parser: 'jsonc-eslint-parser',
66+
rules: {
67+
'jsonc/sort-keys': [
68+
'error',
69+
{
70+
pathPattern: '^$',
71+
order: [
72+
'extends',
73+
'compilerOptions',
74+
'references',
75+
'files',
76+
'include',
77+
'exclude',
78+
],
79+
},
80+
{
81+
pathPattern: '^compilerOptions$',
82+
order: [
83+
/* Projects */
84+
'incremental',
85+
'composite',
86+
'tsBuildInfoFile',
87+
'disableSourceOfProjectReferenceRedirect',
88+
'disableSolutionSearching',
89+
'disableReferencedProjectLoad',
90+
/* Language and Environment */
91+
'target',
92+
'lib',
93+
'jsx',
94+
'experimentalDecorators',
95+
'emitDecoratorMetadata',
96+
'jsxFactory',
97+
'jsxFragmentFactory',
98+
'jsxImportSource',
99+
'reactNamespace',
100+
'noLib',
101+
'useDefineForClassFields',
102+
'moduleDetection',
103+
/* Modules */
104+
'module',
105+
'rootDirs',
106+
'moduleResolution',
107+
'baseUrl',
108+
'paths',
109+
'typeRoots',
110+
'types',
111+
'allowUmdGlobalAccess',
112+
'moduleSuffixes',
113+
'allowImportingTsExtensions',
114+
'resolvePackageJsonExports',
115+
'resolvePackageJsonImports',
116+
'customConditions',
117+
'resolveJsonModule',
118+
'allowArbitraryExtensions',
119+
'noResolve',
120+
/* JavaScript Support */
121+
'allowJs',
122+
'checkJs',
123+
'maxNodeModuleJsDepth',
124+
/* Emit */
125+
'declaration',
126+
'declarationMap',
127+
'emitDeclarationOnly',
128+
'sourceMap',
129+
'inlineSourceMap',
130+
'outFile',
131+
'outDir',
132+
'removeComments',
133+
'noEmit',
134+
'importHelpers',
135+
'importsNotUsedAsValues',
136+
'downlevelIteration',
137+
'sourceRoot',
138+
'mapRoot',
139+
'inlineSources',
140+
'emitBOM',
141+
'newLine',
142+
'stripInternal',
143+
'noEmitHelpers',
144+
'noEmitOnError',
145+
'preserveConstEnums',
146+
'declarationDir',
147+
'preserveValueImports',
148+
/* Interop Constraints */
149+
'isolatedModules',
150+
'verbatimModuleSyntax',
151+
'allowSyntheticDefaultImports',
152+
'esModuleInterop',
153+
'preserveSymlinks',
154+
'forceConsistentCasingInFileNames',
155+
/* Type Checking */
156+
'strict',
157+
'noImplicitAny',
158+
'strictNullChecks',
159+
'strictFunctionTypes',
160+
'strictBindCallApply',
161+
'strictPropertyInitialization',
162+
'noImplicitThis',
163+
'useUnknownInCatchVariables',
164+
'alwaysStrict',
165+
'noUnusedLocals',
166+
'noUnusedParameters',
167+
'exactOptionalPropertyTypes',
168+
'noImplicitReturns',
169+
'noFallthroughCasesInSwitch',
170+
'noUncheckedIndexedAccess',
171+
'noImplicitOverride',
172+
'noPropertyAccessFromIndexSignature',
173+
'allowUnusedLabels',
174+
'allowUnreachableCode',
175+
/* Completeness */
176+
'skipDefaultLibCheck',
177+
'skipLibCheck',
178+
],
179+
},
180+
],
181+
},
63182
}],
64183
),
65184
rules: {

‎tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"compilerOptions": {
3-
"baseUrl": ".",
43
"target": "es2020",
54
"module": "es2020",
65
"moduleResolution": "Bundler",
6+
"baseUrl": ".",
77
"esModuleInterop": true
88
},
99
"include": [

0 commit comments

Comments
 (0)
Please sign in to comment.