mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add package for shared typescript configurations for Lens applications, Features and libraries.
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
parent
766d7fde32
commit
84c6df8714
23
packages/infrastructure/typescript/README.md
Normal file
23
packages/infrastructure/typescript/README.md
Normal file
@ -0,0 +1,23 @@
|
||||
# @k8slens/typescript
|
||||
|
||||
This package contains typescript configurations for Lens packages.
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install @k8slens/typescript
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
### Base configuration
|
||||
Base configuration for minimal duplication.
|
||||
|
||||
**tsconfig.json**
|
||||
```json
|
||||
{
|
||||
"extends": "@k8slens/typescript/config/base.json"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
46
packages/infrastructure/typescript/config/base.json
Normal file
46
packages/infrastructure/typescript/config/base.json
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"jsx": "react",
|
||||
"target": "ES2019",
|
||||
"module": "ESNext",
|
||||
|
||||
"lib": [
|
||||
"ESNext",
|
||||
"DOM",
|
||||
"DOM.Iterable"
|
||||
],
|
||||
|
||||
"moduleResolution": "node16",
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"noImplicitAny": true,
|
||||
"noUnusedLocals": true,
|
||||
"noImplicitReturns": true,
|
||||
"isolatedModules": true,
|
||||
"skipLibCheck": true,
|
||||
"allowJs": false,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"importsNotUsedAsValues": "error",
|
||||
"traceResolution": false,
|
||||
"resolveJsonModule": true,
|
||||
"useDefineForClassFields": true,
|
||||
|
||||
"plugins": [
|
||||
{
|
||||
"name": "typescript-plugin-css-modules"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
"ts-node": {
|
||||
"transpileOnly": true,
|
||||
|
||||
"compilerOptions": {
|
||||
"module": "CommonJS"
|
||||
}
|
||||
},
|
||||
|
||||
"include": ["./styles.d.ts"]
|
||||
}
|
||||
17
packages/infrastructure/typescript/config/styles.d.ts
vendored
Normal file
17
packages/infrastructure/typescript/config/styles.d.ts
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
// Support import for custom module extensions
|
||||
// https://www.typescriptlang.org/docs/handbook/modules.html#wildcard-module-declarations
|
||||
|
||||
declare module "*.module.scss" {
|
||||
const classes: { [key: string]: string };
|
||||
export default classes;
|
||||
}
|
||||
|
||||
declare module "*.module.css" {
|
||||
const classes: { [key: string]: string };
|
||||
export default classes;
|
||||
}
|
||||
|
||||
declare module "*.scss" {
|
||||
const content: string;
|
||||
export = content;
|
||||
}
|
||||
21
packages/infrastructure/typescript/package.json
Normal file
21
packages/infrastructure/typescript/package.json
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "@k8slens/typescript",
|
||||
"private": false,
|
||||
"version": "0.0.1",
|
||||
"description": "Typescript configuration for Lens packages.",
|
||||
"type": "commonjs",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/lensapp/lens.git"
|
||||
},
|
||||
"author": {
|
||||
"name": "OpenLens Authors",
|
||||
"email": "info@k8slens.dev"
|
||||
},
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/lensapp/lens",
|
||||
"dependencies": {
|
||||
"typescript": "^4.9.3",
|
||||
"typescript-plugin-css-modules": "^3.4.0"
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user