Skip to content

Commit

Permalink
Refactor(repo): Use sharable typescript-config-spirit in tsconfig files
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Dec 19, 2024
1 parent 9614b99 commit b53a603
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 257 deletions.
30 changes: 1 addition & 29 deletions exporters/js/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,5 @@
{
"compileOnSave": true,
"compilerOptions": {
"baseUrl": ".",
"outDir": "./dist",
"sourceMap": true,
"declaration": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "es2015",
"target": "es2015",
"noEmit": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"resolveJsonModule": true,
"noImplicitReturns": true,
"allowUnreachableCode": false,
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"forceConsistentCasingInFileNames": true,
"noUnusedParameters": false,
"noUnusedLocals": true,
"strictFunctionTypes": true,
"noImplicitAny": true,
"esModuleInterop": true,
"typeRoots": ["../../node_modules/@types"],
"lib": ["es2015", "dom", "dom.iterable"],
"types": ["node", "jest", "@testing-library/jest-dom"]
},
"extends": "../../configs/typescript-config-spirit/dom",
"include": ["./src/**/*"],
"exclude": ["./node_modules", "./dist/**/*"]
}
30 changes: 1 addition & 29 deletions exporters/scss/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,5 @@
{
"compileOnSave": true,
"compilerOptions": {
"baseUrl": ".",
"outDir": "./dist",
"sourceMap": true,
"declaration": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "es2015",
"target": "es2015",
"noEmit": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"resolveJsonModule": true,
"noImplicitReturns": true,
"allowUnreachableCode": false,
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"forceConsistentCasingInFileNames": true,
"noUnusedParameters": false,
"noUnusedLocals": true,
"strictFunctionTypes": true,
"noImplicitAny": true,
"esModuleInterop": true,
"typeRoots": ["../../node_modules/@types"],
"lib": ["es2015", "dom", "dom.iterable"],
"types": ["node", "jest", "@testing-library/jest-dom"]
},
"extends": "../../configs/typescript-config-spirit/dom",
"include": ["./src/**/*"],
"exclude": ["./node_modules", "./dist/**/*"]
}
30 changes: 1 addition & 29 deletions exporters/tokens/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,5 @@
{
"compileOnSave": true,
"compilerOptions": {
"baseUrl": ".",
"outDir": "./dist",
"sourceMap": true,
"declaration": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "es2015",
"target": "es2015",
"noEmit": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"resolveJsonModule": true,
"noImplicitReturns": true,
"allowUnreachableCode": false,
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"forceConsistentCasingInFileNames": true,
"noUnusedParameters": false,
"noUnusedLocals": true,
"strictFunctionTypes": true,
"noImplicitAny": true,
"esModuleInterop": true,
"typeRoots": ["../../node_modules/@types"],
"lib": ["es2015", "dom", "dom.iterable"],
"types": ["node", "jest", "@testing-library/jest-dom"]
},
"extends": "../../configs/typescript-config-spirit/dom",
"include": ["./src/**/*"],
"exclude": ["./node_modules", "./dist/**/*"]
}
29 changes: 3 additions & 26 deletions packages/analytics/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,8 @@
{
"compileOnSave": true,
"extends": "../../configs/typescript-config-spirit/base",
"compilerOptions": {
"moduleResolution": "node",
"baseUrl": ".",
"outDir": "./dist",
"sourceMap": true,
"declaration": true,
"noEmit": true,
"removeComments": true,
"noEmitOnError": true,
"forceConsistentCasingInFileNames": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"strictFunctionTypes": true,
"resolveJsonModule": true,
"allowUnreachableCode": false,
"allowSyntheticDefaultImports": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noImplicitReturns": true,
"noUnusedParameters": false,
"noUnusedLocals": true,
"noImplicitAny": true,
"esModuleInterop": true,
"skipLibCheck": true,
"typeRoots": ["../../node_modules/@types"],
"types": ["node", "jest"],
// Specify what module code is generated.
// @see: https://www.typescriptlang.org/tsconfig/#module
"module": "es2020"
},
"include": ["./src/**/*"],
Expand Down
27 changes: 1 addition & 26 deletions packages/codemods/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,6 @@
{
"compileOnSave": true,
"extends": "../../configs/typescript-config-spirit/base",
"compilerOptions": {
"moduleResolution": "node",
"baseUrl": ".",
"sourceMap": true,
"declaration": true,
"noEmit": true,
"removeComments": true,
"noEmitOnError": true,
"forceConsistentCasingInFileNames": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"strictFunctionTypes": true,
"resolveJsonModule": true,
"allowUnreachableCode": false,
"allowSyntheticDefaultImports": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noImplicitReturns": true,
"noUnusedParameters": false,
"noUnusedLocals": true,
"noImplicitAny": true,
"esModuleInterop": true,
"skipLibCheck": true,
"typeRoots": ["../../node_modules/@types"],
"types": ["node", "jest"],
"module": "es2020",
"target": "es2020"
},
"include": ["./src/**/*"],
Expand Down
29 changes: 1 addition & 28 deletions packages/common/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,5 @@
{
"compileOnSave": true,
"compilerOptions": {
"moduleResolution": "node",
"baseUrl": ".",
"sourceMap": true,
"declaration": true,
"noEmit": true,
"removeComments": true,
"noEmitOnError": true,
"forceConsistentCasingInFileNames": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"strictFunctionTypes": true,
"resolveJsonModule": true,
"allowUnreachableCode": false,
"allowSyntheticDefaultImports": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noImplicitReturns": true,
"noUnusedParameters": false,
"noUnusedLocals": true,
"noImplicitAny": true,
"esModuleInterop": true,
"skipLibCheck": true,
"typeRoots": ["../../node_modules/@types"],
"types": ["node", "jest"],
"module": "es2020"
},
"extends": "../../configs/typescript-config-spirit/base",
"include": ["./", "./.eslintrc.js"],
"exclude": ["./node_modules"]
}
6 changes: 1 addition & 5 deletions packages/design-tokens/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"compilerOptions": {
"types": ["node"],
"noEmit": true,
"moduleResolution": "node"
},
"extends": "../../configs/typescript-config-spirit/base",
"include": ["src/**/*"]
}
2 changes: 0 additions & 2 deletions packages/form-validations/config/tsconfig.prod.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"module": "es2015",
"target": "es2015",
"noEmit": false
},
"exclude": ["../docs/**/*", "../src/**/__tests__/**/*"]
Expand Down
33 changes: 7 additions & 26 deletions packages/form-validations/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,13 @@
{
"compileOnSave": true,
"extends": "../../configs/typescript-config-spirit/dom",
"compilerOptions": {
"baseUrl": ".",
// Specify an output folder for all emitted files.
// @see: https://www.typescriptlang.org/tsconfig/#outDir
"outDir": "./dist/js",
"sourceMap": true,
"declaration": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "es2015",
"target": "es2015",
"noEmit": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"resolveJsonModule": true,
"noImplicitReturns": true,
"allowUnreachableCode": false,
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"forceConsistentCasingInFileNames": true,
"noUnusedParameters": false,
"noUnusedLocals": true,
"strictFunctionTypes": true,
"noImplicitAny": true,
"esModuleInterop": true,
"typeRoots": ["../../node_modules/@types"],
"lib": ["es2015", "dom", "dom.iterable"],
"types": ["node", "jest", "@testing-library/jest-dom"]

// Enable error reporting when 'this' is given the type 'any'.
// @see: https://www.typescriptlang.org/tsconfig/#noImplicitThis
"noImplicitThis": false
},
"include": ["./src/**/*"],
"exclude": ["./node_modules", "./dist/**/*"]
Expand Down
36 changes: 11 additions & 25 deletions packages/web-react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,17 @@
{
"compileOnSave": true,
"extends": "../../configs/typescript-config-spirit/dom",
"compilerOptions": {
"baseUrl": ".",
"outDir": "./dist",
"sourceMap": true,
"declaration": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noEmit": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"resolveJsonModule": true,
"noImplicitReturns": true,
"allowUnreachableCode": false,
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
// Specify what JSX code is generated.
// @see: https://www.typescriptlang.org/tsconfig/#jsx
"jsx": "react",
"forceConsistentCasingInFileNames": true,
"noUnusedParameters": false,
"noUnusedLocals": true,
"strictFunctionTypes": true,
"noImplicitAny": true,
"esModuleInterop": true,
"skipLibCheck": true,
"lib": ["es2016", "dom", "dom.iterable"],
"types": ["jest", "node"]

// Specify what module code is generated.
// @see: https://www.typescriptlang.org/tsconfig/#module
"module": "nodenext",

// Specify how TypeScript looks up a file from a given module specifier.
// @see: https://www.typescriptlang.org/tsconfig/#moduleResolution
"moduleResolution": "nodenext"
},
"include": ["./src/**/*"],
"exclude": ["./node_modules", "./dist/**/*"]
Expand Down
3 changes: 1 addition & 2 deletions packages/web/config/tsconfig.prod.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"module": "es2015",
"target": "es2015",
"noEmit": false
},
"include": ["../src/js/*"],
"exclude": ["../docs/**/*", "../src/**/__tests__/**/*"]
}
2 changes: 1 addition & 1 deletion packages/web/src/js/utils/ComponentFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const onClickHandler = (
event: Event,
aim: Aim = 'target',
) => {
EventHandler.on(element, 'click', function handleClick() {
EventHandler.on(element, 'click', function handleClick(this: unknown) {
const target = getTriggerOrTarget(getElement(this), aim);
const instance = component.getOrCreateInstance(target);

Expand Down
30 changes: 1 addition & 29 deletions packages/web/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,5 @@
{
"compileOnSave": true,
"compilerOptions": {
"baseUrl": ".",
"outDir": "./dist/js",
"sourceMap": true,
"declaration": true,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "es2015",
"target": "es2015",
"noEmit": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"resolveJsonModule": true,
"noImplicitReturns": true,
"allowUnreachableCode": false,
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"forceConsistentCasingInFileNames": true,
"noUnusedParameters": false,
"noUnusedLocals": true,
"strictFunctionTypes": true,
"noImplicitAny": true,
"esModuleInterop": true,
"typeRoots": ["../../node_modules/@types"],
"lib": ["es2015", "dom", "dom.iterable"],
"types": ["node", "jest", "@testing-library/jest-dom"]
},
"extends": "../../configs/typescript-config-spirit/dom",
"include": ["./src/**/*"],
"exclude": ["./node_modules", "./dist/**/*"]
}

0 comments on commit b53a603

Please sign in to comment.