From a384ecac1e036a66d5a7e95f9bb6790f34a592d9 Mon Sep 17 00:00:00 2001 From: splincode Date: Tue, 17 Oct 2023 11:31:45 +0300 Subject: [PATCH] feat(tsconfig): add `@taiga-ui/tsconfig` --- README.md | 1 + projects/browserslist-config/.npmignore | 2 + projects/commitlint-config/.npmignore | 2 + projects/cspell-config/.npmignore | 2 + projects/cspell-config/package.json | 2 +- projects/prettier-config/package.json | 2 +- projects/stylelint-config/.npmignore | 2 + projects/stylelint-config/package.json | 2 +- projects/tsconfig/.npmignore | 2 + projects/tsconfig/README.md | 30 +++++++++ projects/tsconfig/package.json | 18 ++++++ projects/tsconfig/project.json | 14 ++++ projects/tsconfig/tsconfig.json | 85 +++++++++++++++++++++++++ 13 files changed, 161 insertions(+), 3 deletions(-) create mode 100644 projects/browserslist-config/.npmignore create mode 100644 projects/commitlint-config/.npmignore create mode 100644 projects/cspell-config/.npmignore create mode 100644 projects/stylelint-config/.npmignore create mode 100644 projects/tsconfig/.npmignore create mode 100644 projects/tsconfig/README.md create mode 100644 projects/tsconfig/package.json create mode 100644 projects/tsconfig/project.json create mode 100644 projects/tsconfig/tsconfig.json diff --git a/README.md b/README.md index feaed37f..e209adba 100644 --- a/README.md +++ b/README.md @@ -12,3 +12,4 @@ Monorepo for all the tooling which enables ESLint, Prettier, Stylelint to suppor | [@taiga-ui/cspell-config](https://npmjs.com/package/@taiga-ui/cspell-config) | ![](https://img.shields.io/npm/v/%40taiga-ui%2Fcspell-config/latest.svg) | [![](https://img.shields.io/badge/README--green.svg)](projects/cspell-config/README.md) | [![](https://img.shields.io/npm/dw/@taiga-ui/cspell-config)](https://npmjs.com/package/@taiga-ui/cspell-config) | | [@taiga-ui/commitlint-config](https://npmjs.com/package/@taiga-ui/commitlint-config) | ![](https://img.shields.io/npm/v/%40taiga-ui%2Fcommitlint-config/latest.svg) | [![](https://img.shields.io/badge/README--green.svg)](projects/commitlint-config/README.md) | [![](https://img.shields.io/npm/dw/@taiga-ui/commitlint-config)](https://npmjs.com/package/@taiga-ui/commitlint-config) | | [@taiga-ui/browserslist-config](https://npmjs.com/package/@taiga-ui/browserslist-config) | ![](https://img.shields.io/npm/v/%40taiga-ui%2Fbrowserslist-config/latest.svg) | [![](https://img.shields.io/badge/README--green.svg)](projects/browserslist-config/README.md) | [![](https://img.shields.io/npm/dw/@taiga-ui/browserslist-config)](https://npmjs.com/package/@taiga-ui/browserslist-config) | +| [@taiga-ui/tsconfig](https://npmjs.com/package/@taiga-ui/tsconfig) | ![](https://img.shields.io/npm/v/%40taiga-ui%2Ftsconfig/latest.svg) | [![](https://img.shields.io/badge/README--green.svg)](projects/tsconfig/README.md) | [![](https://img.shields.io/npm/dw/@taiga-ui/tsconfig)](https://npmjs.com/package/@taiga-ui/tsconfig) | diff --git a/projects/browserslist-config/.npmignore b/projects/browserslist-config/.npmignore new file mode 100644 index 00000000..8c44d8c1 --- /dev/null +++ b/projects/browserslist-config/.npmignore @@ -0,0 +1,2 @@ +node_modules +project.json diff --git a/projects/commitlint-config/.npmignore b/projects/commitlint-config/.npmignore new file mode 100644 index 00000000..8c44d8c1 --- /dev/null +++ b/projects/commitlint-config/.npmignore @@ -0,0 +1,2 @@ +node_modules +project.json diff --git a/projects/cspell-config/.npmignore b/projects/cspell-config/.npmignore new file mode 100644 index 00000000..8c44d8c1 --- /dev/null +++ b/projects/cspell-config/.npmignore @@ -0,0 +1,2 @@ +node_modules +project.json diff --git a/projects/cspell-config/package.json b/projects/cspell-config/package.json index 243a1f79..caece012 100644 --- a/projects/cspell-config/package.json +++ b/projects/cspell-config/package.json @@ -7,7 +7,7 @@ ], "repository": { "type": "git", - "url": "https://github.com/taiga-family/taiga-ui.git" + "url": "https://github.com/taiga-family/linters.git" }, "license": "Apache-2.0", "main": "cspell.config.js", diff --git a/projects/prettier-config/package.json b/projects/prettier-config/package.json index e05e9cf3..70125898 100644 --- a/projects/prettier-config/package.json +++ b/projects/prettier-config/package.json @@ -8,7 +8,7 @@ ], "repository": { "type": "git", - "url": "https://github.com/taiga-family/taiga-ui.git" + "url": "https://github.com/taiga-family/linters.git" }, "license": "Apache-2.0", "main": "index.js", diff --git a/projects/stylelint-config/.npmignore b/projects/stylelint-config/.npmignore new file mode 100644 index 00000000..8c44d8c1 --- /dev/null +++ b/projects/stylelint-config/.npmignore @@ -0,0 +1,2 @@ +node_modules +project.json diff --git a/projects/stylelint-config/package.json b/projects/stylelint-config/package.json index 5798958e..c3e8ebba 100644 --- a/projects/stylelint-config/package.json +++ b/projects/stylelint-config/package.json @@ -8,7 +8,7 @@ ], "repository": { "type": "git", - "url": "https://github.com/taiga-family/taiga-ui.git" + "url": "https://github.com/taiga-family/linters.git" }, "license": "Apache-2.0", "main": "stylelint.config.js", diff --git a/projects/tsconfig/.npmignore b/projects/tsconfig/.npmignore new file mode 100644 index 00000000..8c44d8c1 --- /dev/null +++ b/projects/tsconfig/.npmignore @@ -0,0 +1,2 @@ +node_modules +project.json diff --git a/projects/tsconfig/README.md b/projects/tsconfig/README.md new file mode 100644 index 00000000..a7823fe4 --- /dev/null +++ b/projects/tsconfig/README.md @@ -0,0 +1,30 @@ +# Shareable TypeScript config for Angular projects + +[![image](https://badge.fury.io/js/%40taiga-ui%2Ftsconfig.svg)](https://badge.fury.io/js/%40taiga-ui%2Ftsconfig) +[![image](https://img.shields.io/npm/dw/@taiga-ui/tsconfig)](https://badge.fury.io/js/%40taiga-ui%2Ftsconfig) + +### Quick start + +```bash +$ npm install @taiga-ui/tsconfig -D +``` + +Add to your `tsconfig.json`: + +```json5 +{ + extends: '@taiga-ui/tsconfig', + angularCompilerOptions: { + // override shared angularCompilerOptions + strictTemplates: true, + disableTypeScriptVersionCheck: true, + }, + compilerOptions: { + // override shared compilerOptions + outDir: 'dist', + target: 'es2018', + lib: ['es2018'], + typeRoots: ['./node_modules/@types'], + }, +} +``` diff --git a/projects/tsconfig/package.json b/projects/tsconfig/package.json new file mode 100644 index 00000000..576104d0 --- /dev/null +++ b/projects/tsconfig/package.json @@ -0,0 +1,18 @@ +{ + "name": "@taiga-ui/tsconfig", + "version": "0.1.0", + "description": "Taiga UI tsconfig", + "keywords": [ + "taiga-ui", + "tsconfig" + ], + "repository": { + "type": "git", + "url": "https://github.com/taiga-family/linters.git" + }, + "license": "Apache-2.0", + "main": "tsconfig.json", + "publishConfig": { + "access": "public" + } +} diff --git a/projects/tsconfig/project.json b/projects/tsconfig/project.json new file mode 100644 index 00000000..59cff95d --- /dev/null +++ b/projects/tsconfig/project.json @@ -0,0 +1,14 @@ +{ + "name": "tsconfig", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "projects/tsconfig", + "projectType": "library", + "targets": { + "publish": { + "executor": "nx:run-commands", + "options": { + "command": "npm publish ./projects/tsconfig --access=public --ignore-scripts || echo \"already published\"" + } + } + } +} diff --git a/projects/tsconfig/tsconfig.json b/projects/tsconfig/tsconfig.json new file mode 100644 index 00000000..0444788d --- /dev/null +++ b/projects/tsconfig/tsconfig.json @@ -0,0 +1,85 @@ +{ + "compileOnSave": false, + "angularCompilerOptions": { + "enableIvy": true, + "compilationMode": "partial", + "preserveWhitespaces": false, + "annotateForClosureCompiler": false, + "skipTemplateCodegen": true, + "strictMetadataEmit": true, + "fullTemplateTypeCheck": true, + "strictInjectionParameters": true, + "enableResourceInlining": true, + "strictLiteralTypes": true, + "strictInputTypes": true, + "strictInputAccessModifiers": true, + "strictNullInputTypes": true, + "strictAttributeTypes": true, + "strictSafeNavigationTypes": true, + "strictDomLocalRefTypes": true, + "strictOutputEventTypes": true, + "strictDomEventTypes": true, + "strictContextGenerics": true + }, + "compilerOptions": { + "strict": true, + "baseUrl": "./", + "outDir": "./dist", + "target": "es2015", + "module": "es2020", + "lib": ["es2017", "es2018.asynciterable", "dom"], + "typeRoots": ["node_modules/@types", "scripts/types"], + "types": ["ng-dev-mode", "node"], + "skipLibCheck": true, + "downlevelIteration": true, + "skipDefaultLibCheck": true, + "declaration": true, + "declarationMap": true, + "moduleResolution": "node", + "experimentalDecorators": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "importHelpers": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": true, + "noImplicitReturns": true, + "noUnusedParameters": true, + "incremental": false, + "newLine": "lf", + "alwaysStrict": true, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + "noStrictGenericChecks": false, + "allowUmdGlobalAccess": true, + "useDefineForClassFields": false, + "forceConsistentCasingInFileNames": true, + "tsBuildInfoFile": null, + "noImplicitOverride": true, + "preserveConstEnums": true, + "noEmitHelpers": true, + "pretty": true, + "stripInternal": true, + "noUncheckedIndexedAccess": false, + "importsNotUsedAsValues": "remove", + "noPropertyAccessFromIndexSignature": false, + "removeComments": true, + "noEmitOnError": true, + "allowJs": true, + "checkJs": true, + "disableSizeLimit": true, + "strictNullChecks": true, + "preserveSymlinks": true, + "strictBindCallApply": true, + "strictFunctionTypes": true, + "strictPropertyInitialization": true + }, + "ts-node": { + "files": true, + "transpileOnly": true, + "compilerOptions": { + "types": ["node"], + "module": "commonjs" + } + } +}