Skip to content

Commit a663702

Browse files
committed
feat(ts): add tsconfig.json order
1 parent 1d4951c commit a663702

File tree

1 file changed

+121
-0
lines changed

1 file changed

+121
-0
lines changed

packages/eslint-config-ts/index.js

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

0 commit comments

Comments
 (0)