mirror of
				https://github.com/actions-rs/cargo.git
				synced 2025-10-31 19:53:50 +00:00 
			
		
		
		
	Add formatting and linting tools
This commit is contained in:
		
							parent
							
								
									ecffd7835a
								
							
						
					
					
						commit
						efdda56b63
					
				
							
								
								
									
										19
									
								
								.eslintrc.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								.eslintrc.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,19 @@ | |||||||
|  | { | ||||||
|  |   "parser": "@typescript-eslint/parser", | ||||||
|  |   "parserOptions": { | ||||||
|  |     "project": "./tsconfig.eslint.json" | ||||||
|  |   }, | ||||||
|  |   "plugins": ["@typescript-eslint"], | ||||||
|  |   "extends": [ | ||||||
|  |     "eslint:recommended", | ||||||
|  |     "plugin:@typescript-eslint/eslint-recommended", | ||||||
|  |     "plugin:@typescript-eslint/recommended-requiring-type-checking", | ||||||
|  |     "plugin:@typescript-eslint/recommended", | ||||||
|  |     "plugin:prettier/recommended", | ||||||
|  |     "prettier", | ||||||
|  |     "prettier/@typescript-eslint" | ||||||
|  |   ], | ||||||
|  |   "rules": { | ||||||
|  |     "@typescript-eslint/ban-ts-ignore": "off" | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										3
									
								
								.github/FUNDING.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.github/FUNDING.yml
									
									
									
									
										vendored
									
									
								
							| @ -1,3 +0,0 @@ | |||||||
| liberapay: svartalf |  | ||||||
| patreon: svartalf |  | ||||||
| custom: ["https://svartalf.info/donate/", "https://www.buymeacoffee.com/svartalf"] |  | ||||||
							
								
								
									
										25
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										25
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							| @ -3,21 +3,16 @@ name: Continuous integration | |||||||
| on: [pull_request, push] | on: [pull_request, push] | ||||||
| 
 | 
 | ||||||
| jobs: | jobs: | ||||||
|   check_pr: |   test: | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     steps: |     steps: | ||||||
|     - name: Create npm configuration |       - name: Create npm configuration | ||||||
|       run: echo "//npm.pkg.github.com/:_authToken=${token}" >> ~/.npmrc |         run: echo "//npm.pkg.github.com/:_authToken=${token}" >> ~/.npmrc | ||||||
|       env: |         env: | ||||||
|         token: ${{ secrets.GITHUB_TOKEN }} |           token: ${{ secrets.GITHUB_TOKEN }} | ||||||
| 
 | 
 | ||||||
|     - uses: actions/checkout@v1 |       - uses: actions/checkout@v2 | ||||||
| 
 |       - run: npm ci | ||||||
|     - name: "npm ci" |       - run: npm run lint | ||||||
|       run: npm ci |       - run: npm run build | ||||||
| 
 |       - run: npm run test | ||||||
|     - name: "npm run build" |  | ||||||
|       run: npm run build |  | ||||||
| 
 |  | ||||||
|     - name: "npm run test" |  | ||||||
|       run: npm run test |  | ||||||
|  | |||||||
							
								
								
									
										45
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										45
									
								
								README.md
									
									
									
									
									
								
							| @ -1,11 +1,23 @@ | |||||||
| # Rust `cargo` Action | # Rust `cargo` Action | ||||||
| 
 | 
 | ||||||
|  | [](https://actions-rs.github.io/#sponsoring) | ||||||
|  |  | ||||||
| [](https://gitter.im/actions-rs/community) | [](https://gitter.im/actions-rs/community) | ||||||
|  |  | ||||||
|  |  | ||||||
| 
 | 
 | ||||||
| This GitHub Action runs specified [`cargo`](https://github.com/rust-lang/cargo) | This GitHub Action runs specified [`cargo`](https://github.com/rust-lang/cargo) | ||||||
| command on a Rust language project. | command on a Rust language project. | ||||||
| 
 | 
 | ||||||
|  | **Table of Contents** | ||||||
|  | 
 | ||||||
|  | * [Example workflow](#example-workflow) | ||||||
|  | * [Inputs](#inputs) | ||||||
|  | * [Virtual environments](#virtual-environments) | ||||||
|  | * [Cross-compilation](#cross-compilation) | ||||||
|  | * [License](#license) | ||||||
|  | * [Contribute and support](#contribute-and-support) | ||||||
|  | 
 | ||||||
| ## Example workflow | ## Example workflow | ||||||
| 
 | 
 | ||||||
| ```yaml | ```yaml | ||||||
| @ -18,7 +30,7 @@ jobs: | |||||||
|     name: Rust project |     name: Rust project | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@master |       - uses: actions/checkout@v2 | ||||||
|       - uses: actions-rs/cargo@v1 |       - uses: actions-rs/cargo@v1 | ||||||
|         with: |         with: | ||||||
|           command: build |           command: build | ||||||
| @ -36,22 +48,23 @@ See [additional recipes here](https://github.com/actions-rs/meta). | |||||||
| | `args`      |          | Arguments for the cargo command                                          | string |         |      | | `args`      |          | Arguments for the cargo command                                          | string |         |      | ||||||
| | `use-cross` |          | Use [`cross`](https://github.com/rust-embedded/cross) instead of `cargo` | bool   | false   | | | `use-cross` |          | Use [`cross`](https://github.com/rust-embedded/cross) instead of `cargo` | bool   | false   | | ||||||
| 
 | 
 | ||||||
| ## Virtual environments | ## Toolchain | ||||||
| 
 | 
 | ||||||
| Note that `cargo` is not available by default for some [virtual environments](https://help.github.com/en/articles/software-in-virtual-environments-for-github-actions); | By default this Action will call whatever `cargo` binary is available | ||||||
| for example, as for 2019-09-15, `macOS` env is missing it. | in the current [virtual environment](https://help.github.com/en/articles/software-in-virtual-environments-for-github-actions). | ||||||
| 
 | 
 | ||||||
| You can use [`actions-rs/toolchain`](https://github.com/actions-rs/toolchain) | You can use [`actions-rs/toolchain`](https://github.com/actions-rs/toolchain) | ||||||
| to install the Rust toolchain with `cargo` included. | to install specific Rust toolchain with `cargo` included. | ||||||
| 
 | 
 | ||||||
| ## Cross | ## Cross-compilation | ||||||
| 
 | 
 | ||||||
| In order to make cross-compilation an easy process, | In order to make cross-compile an easy process, | ||||||
| this Action can install [cross](https://github.com/rust-embedded/cross) | this Action can install [cross](https://github.com/rust-embedded/cross) | ||||||
| tool on demand if `use-cross` input is enabled; `cross` executable will be invoked | tool on demand if `use-cross` input is enabled; `cross` executable will be invoked | ||||||
| then instead of `cargo` automatically. | then instead of `cargo` automatically. | ||||||
| 
 | 
 | ||||||
| All consequent calls of this Action in the same job will use the same `cross` installed. | All consequent calls of this Action in the same job | ||||||
|  | with `use-cross: true` input enabled will use the same `cross` installed. | ||||||
| 
 | 
 | ||||||
| ```yaml | ```yaml | ||||||
| on: [push] | on: [push] | ||||||
| @ -63,7 +76,7 @@ jobs: | |||||||
|     name: Linux ARMv7 |     name: Linux ARMv7 | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
|     steps: |     steps: | ||||||
|       - uses: actions/checkout@master |       - uses: actions/checkout@v2 | ||||||
|       - uses: actions-rs/toolchain@v1 |       - uses: actions-rs/toolchain@v1 | ||||||
|         with: |         with: | ||||||
|           toolchain: stable |           toolchain: stable | ||||||
| @ -75,3 +88,17 @@ jobs: | |||||||
|           command: build |           command: build | ||||||
|           args: --target armv7-unknown-linux-gnueabihf |           args: --target armv7-unknown-linux-gnueabihf | ||||||
| ``` | ``` | ||||||
|  | 
 | ||||||
|  | ## License | ||||||
|  | 
 | ||||||
|  | This Action is distributed under the terms of the MIT license, see [LICENSE](https://github.com/actions-rs/toolchain/blob/master/LICENSE) for details. | ||||||
|  | 
 | ||||||
|  | ## Contribute and support | ||||||
|  | 
 | ||||||
|  | Any contributions are welcomed! | ||||||
|  | 
 | ||||||
|  | If you want to report a bug or have a feature request, | ||||||
|  | check the [Contributing guide](https://github.com/actions-rs/.github/blob/master/CONTRIBUTING.md). | ||||||
|  | 
 | ||||||
|  | You can also support author by funding the ongoing project work, | ||||||
|  | see [Sponsoring](https://actions-rs.github.io/#sponsoring). | ||||||
|  | |||||||
| @ -1,32 +1,33 @@ | |||||||
| import * as input from '../src/input' | import * as input from "../src/input"; | ||||||
| 
 | 
 | ||||||
| const testEnvVars = { | const testEnvVars = { | ||||||
|     INPUT_COMMAND: 'build', |     INPUT_COMMAND: "build", | ||||||
|     // There are few unnecessary spaces here to check that args parser works properly
 |     // There are few unnecessary spaces here to check that args parser works properly
 | ||||||
|     INPUT_ARGS: '   --release --target x86_64-unknown-linux-gnu    --no-default-features --features unstable       ', |     INPUT_ARGS: | ||||||
|     'INPUT_USE-CROSS': 'true', |         "   --release --target x86_64-unknown-linux-gnu    --no-default-features --features unstable       ", | ||||||
|     INPUT_TOOLCHAIN: '+nightly' |     "INPUT_USE-CROSS": "true", | ||||||
| } |     INPUT_TOOLCHAIN: "+nightly", | ||||||
|  | }; | ||||||
| 
 | 
 | ||||||
| describe('actions-rs/cargo/input', () => { | describe("actions-rs/cargo/input", () => { | ||||||
|     beforeEach(() => { |     beforeEach(() => { | ||||||
|     for (const key in testEnvVars) |         for (const key in testEnvVars) | ||||||
|         process.env[key] = testEnvVars[key as keyof typeof testEnvVars] |             process.env[key] = testEnvVars[key as keyof typeof testEnvVars]; | ||||||
|     }) |     }); | ||||||
| 
 | 
 | ||||||
|     it('Parses action input into cargo input', async () => { |     it("Parses action input into cargo input", () => { | ||||||
|         const result = input.get(); |         const result = input.get(); | ||||||
| 
 | 
 | ||||||
|         expect(result.command).toBe('build'); |         expect(result.command).toBe("build"); | ||||||
|         expect(result.args).toStrictEqual([ |         expect(result.args).toStrictEqual([ | ||||||
|             '--release', |             "--release", | ||||||
|             '--target', |             "--target", | ||||||
|             'x86_64-unknown-linux-gnu', |             "x86_64-unknown-linux-gnu", | ||||||
|             '--no-default-features', |             "--no-default-features", | ||||||
|             '--features', |             "--features", | ||||||
|             'unstable' |             "unstable", | ||||||
|         ]); |         ]); | ||||||
|         expect(result.useCross).toBe(true); |         expect(result.useCross).toBe(true); | ||||||
|         expect(result.toolchain).toBe('nightly'); |         expect(result.toolchain).toBe("nightly"); | ||||||
|     }); |     }); | ||||||
| }); | }); | ||||||
|  | |||||||
							
								
								
									
										2
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @ -1,11 +0,0 @@ | |||||||
| module.exports = { |  | ||||||
|   clearMocks: true, |  | ||||||
|   moduleFileExtensions: ['js', 'ts'], |  | ||||||
|   testEnvironment: 'node', |  | ||||||
|   testMatch: ['**/*.test.ts'], |  | ||||||
|   testRunner: 'jest-circus/runner', |  | ||||||
|   transform: { |  | ||||||
|     '^.+\\.ts$': 'ts-jest' |  | ||||||
|   }, |  | ||||||
|   verbose: true |  | ||||||
| } |  | ||||||
							
								
								
									
										11
									
								
								jest.config.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								jest.config.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,11 @@ | |||||||
|  | { | ||||||
|  |   "clearMocks": true, | ||||||
|  |   "moduleFileExtensions": ["js", "ts"], | ||||||
|  |   "testEnvironment": "node", | ||||||
|  |   "testMatch": ["**/*.test.ts"], | ||||||
|  |   "testRunner": "jest-circus/runner", | ||||||
|  |   "transform": { | ||||||
|  |     "^.+\\.ts$": "ts-jest" | ||||||
|  |   }, | ||||||
|  |   "verbose": true | ||||||
|  | } | ||||||
							
								
								
									
										2983
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2983
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										25
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								package.json
									
									
									
									
									
								
							| @ -10,9 +10,11 @@ | |||||||
|     }, |     }, | ||||||
|     "scripts": { |     "scripts": { | ||||||
|         "bundle": "cp -r .matchers ./dist/", |         "bundle": "cp -r .matchers ./dist/", | ||||||
|         "build": "ncc build src/main.ts --minify && npm run bundle", |         "build": "rm -rf ./dist/* && ncc build src/main.ts --minify && npm run bundle", | ||||||
|         "watch": "npm run bundle && ncc build src/main.ts --watch --minify", |         "format": "prettier --write 'src/**/*.ts' '__tests__/**/*.ts'", | ||||||
|         "test": "jest" |         "lint": "tsc --noEmit && eslint 'src/**/*.ts' '__tests__/**/*.ts'", | ||||||
|  |         "watch": "rm -rf ./dist/* && ncc build src/main.ts --watch", | ||||||
|  |         "test": "jest -c jest.config.json" | ||||||
|     }, |     }, | ||||||
|     "repository": { |     "repository": { | ||||||
|         "type": "git", |         "type": "git", | ||||||
| @ -29,16 +31,23 @@ | |||||||
|         "url": "https://github.com/actions-rs/cargo/issues" |         "url": "https://github.com/actions-rs/cargo/issues" | ||||||
|     }, |     }, | ||||||
|     "dependencies": { |     "dependencies": { | ||||||
|         "@actions-rs/core": "0.0.8", |         "@actions-rs/core": "0.0.9", | ||||||
|         "@actions/core": "^1.1.1", |         "@actions/core": "^1.2.3", | ||||||
|         "string-argv": "^0.3.1" |         "string-argv": "^0.3.1" | ||||||
|     }, |     }, | ||||||
|     "devDependencies": { |     "devDependencies": { | ||||||
|         "@types/jest": "^25.1.3", |         "@types/jest": "^25.1.4", | ||||||
|         "@types/node": "^13.7.7", |         "@types/node": "^13.9.3", | ||||||
|         "@zeit/ncc": "^0.21.1", |         "@typescript-eslint/eslint-plugin": "^2.25.0", | ||||||
|  |         "@typescript-eslint/parser": "^2.25.0", | ||||||
|  |         "@zeit/ncc": "^0.22.0", | ||||||
|  |         "eslint": "^6.8.0", | ||||||
|  |         "eslint-config-prettier": "^6.10.1", | ||||||
|  |         "eslint-plugin-prettier": "^3.1.2", | ||||||
|         "jest": "^25.1.0", |         "jest": "^25.1.0", | ||||||
|         "jest-circus": "^25.1.0", |         "jest-circus": "^25.1.0", | ||||||
|  |         "npm-check-updates": "^4.0.5", | ||||||
|  |         "prettier": "^2.0.2", | ||||||
|         "ts-jest": "^25.2.1", |         "ts-jest": "^25.2.1", | ||||||
|         "typescript": "^3.8.3" |         "typescript": "^3.8.3" | ||||||
|     } |     } | ||||||
|  | |||||||
							
								
								
									
										26
									
								
								src/input.ts
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								src/input.ts
									
									
									
									
									
								
							| @ -2,31 +2,31 @@ | |||||||
|  * Parse action input into a some proper thing. |  * Parse action input into a some proper thing. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| import {input} from '@actions-rs/core'; | import { input } from "@actions-rs/core"; | ||||||
| 
 | 
 | ||||||
| import stringArgv from 'string-argv'; | import stringArgv from "string-argv"; | ||||||
| 
 | 
 | ||||||
| // Parsed action input
 | // Parsed action input
 | ||||||
| export interface Input { | export interface Input { | ||||||
|     command: string, |     command: string; | ||||||
|     toolchain?: string, |     toolchain?: string; | ||||||
|     args: string[], |     args: string[]; | ||||||
|     useCross: boolean, |     useCross: boolean; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| export function get(): Input { | export function get(): Input { | ||||||
|     const command = input.getInput('command', {required: true}); |     const command = input.getInput("command", { required: true }); | ||||||
|     const args = stringArgv(input.getInput('args')); |     const args = stringArgv(input.getInput("args")); | ||||||
|     let toolchain = input.getInput('toolchain'); |     let toolchain = input.getInput("toolchain"); | ||||||
|     if (toolchain.startsWith('+')) { |     if (toolchain.startsWith("+")) { | ||||||
|         toolchain = toolchain.slice(1); |         toolchain = toolchain.slice(1); | ||||||
|     } |     } | ||||||
|     const useCross = input.getInputBool('use-cross'); |     const useCross = input.getInputBool("use-cross"); | ||||||
| 
 | 
 | ||||||
|     return { |     return { | ||||||
|         command: command, |         command: command, | ||||||
|         args: args, |         args: args, | ||||||
|         useCross: useCross, |         useCross: useCross, | ||||||
|         toolchain: toolchain || undefined |         toolchain: toolchain || undefined, | ||||||
|     } |     }; | ||||||
| } | } | ||||||
|  | |||||||
							
								
								
									
										12
									
								
								src/main.ts
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								src/main.ts
									
									
									
									
									
								
							| @ -1,9 +1,9 @@ | |||||||
| const path = require('path'); | import path from "path"; | ||||||
| 
 | 
 | ||||||
| import * as core from '@actions/core'; | import * as core from "@actions/core"; | ||||||
| 
 | 
 | ||||||
| import * as input from './input'; | import * as input from "./input"; | ||||||
| import {Cargo, Cross} from '@actions-rs/core'; | import { Cargo, Cross } from "@actions-rs/core"; | ||||||
| 
 | 
 | ||||||
| export async function run(actionInput: input.Input): Promise<void> { | export async function run(actionInput: input.Input): Promise<void> { | ||||||
|     let program; |     let program; | ||||||
| @ -24,8 +24,8 @@ export async function run(actionInput: input.Input): Promise<void> { | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| async function main(): Promise<void> { | async function main(): Promise<void> { | ||||||
|     const matchersPath = path.join(__dirname, '.matchers'); |     const matchersPath = path.join(__dirname, ".matchers"); | ||||||
|     console.log(`::add-matcher::${path.join(matchersPath, 'rust.json')}`); |     console.log(`::add-matcher::${path.join(matchersPath, "rust.json")}`); | ||||||
| 
 | 
 | ||||||
|     const actionInput = input.get(); |     const actionInput = input.get(); | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										7
									
								
								tsconfig.eslint.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								tsconfig.eslint.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,7 @@ | |||||||
|  | { | ||||||
|  |     "extends": "./tsconfig.json", | ||||||
|  |     "include": [ | ||||||
|  |         "src/**/*.ts", | ||||||
|  |         "__tests__/**/*.ts" | ||||||
|  |     ] | ||||||
|  | } | ||||||
| @ -1,63 +1,31 @@ | |||||||
| { | { | ||||||
|   "compilerOptions": { |     "compilerOptions": { | ||||||
|     /* Basic Options */ |         "allowJs": false, | ||||||
|     // "incremental": true,                   /* Enable incremental compilation */ |         "checkJs": false, | ||||||
|     "target": "es6",                          /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ |         "esModuleInterop": true, | ||||||
|     "module": "commonjs",                     /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ |         "forceConsistentCasingInFileNames": true, | ||||||
|     "allowJs": false,                       /* Allow javascript files to be compiled. */ |         "module": "commonjs", | ||||||
|     // "checkJs": true,                       /* Report errors in .js files. */ |         "moduleResolution": "node", | ||||||
|     // "jsx": "preserve",                     /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ |         "newLine": "LF", | ||||||
|     // "declaration": true,                   /* Generates corresponding '.d.ts' file. */ |         "noEmitOnError": true, | ||||||
|     // "declarationMap": true,                /* Generates a sourcemap for each corresponding '.d.ts' file. */ |         "noErrorTruncation": true, | ||||||
|     // "sourceMap": true,                     /* Generates corresponding '.map' file. */ |         "noFallthroughCasesInSwitch": true, | ||||||
|     // "outFile": "./",                       /* Concatenate and emit output to single file. */ |         "noImplicitAny": true, | ||||||
|     "outDir": "./lib",                        /* Redirect output structure to the directory. */ |         "noImplicitReturns": true, | ||||||
|     "rootDir": "./src",                       /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ |         "noImplicitThis": true, | ||||||
|     // "composite": true,                     /* Enable project compilation */ |         "noUnusedLocals": true, | ||||||
|     // "tsBuildInfoFile": "./",               /* Specify file to store incremental compilation information */ |         "noUnusedParameters": true, | ||||||
|     // "removeComments": true,                /* Do not emit comments to output. */ |         "outDir": "dist", | ||||||
|     // "noEmit": true,                        /* Do not emit outputs. */ |         "pretty": true, | ||||||
|     // "importHelpers": true,                 /* Import emit helpers from 'tslib'. */ |         "removeComments": true, | ||||||
|     // "downlevelIteration": true,            /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ |         "resolveJsonModule": true, | ||||||
|     // "isolatedModules": true,               /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ |         "strict": true, | ||||||
| 
 |         "suppressImplicitAnyIndexErrors": false, | ||||||
|     /* Strict Type-Checking Options */ |         "target": "es2018", | ||||||
|     "strict": true,                           /* Enable all strict type-checking options. */ |         "declaration": false, | ||||||
|     "noImplicitAny": false,                 /* Raise error on expressions and declarations with an implied 'any' type. */ |         "sourceMap": false | ||||||
|     // "strictNullChecks": true,              /* Enable strict null checks. */ |     }, | ||||||
|     // "strictFunctionTypes": true,           /* Enable strict checking of function types. */ |     "include": [ | ||||||
|     // "strictBindCallApply": true,           /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ |         "src/**/*.ts" | ||||||
|     // "strictPropertyInitialization": true,  /* Enable strict checking of property initialization in classes. */ |     ] | ||||||
|     // "noImplicitThis": true,                /* Raise error on 'this' expressions with an implied 'any' type. */ |  | ||||||
|     // "alwaysStrict": true,                  /* Parse in strict mode and emit "use strict" for each source file. */ |  | ||||||
| 
 |  | ||||||
|     /* Additional Checks */ |  | ||||||
|     "noUnusedLocals": true,                /* Report errors on unused locals. */ |  | ||||||
|     "noUnusedParameters": true,            /* Report errors on unused parameters. */ |  | ||||||
|     "noImplicitReturns": true,             /* Report error when not all code paths in function return a value. */ |  | ||||||
|     "noFallthroughCasesInSwitch": true,    /* Report errors for fallthrough cases in switch statement. */ |  | ||||||
| 
 |  | ||||||
|     /* Module Resolution Options */ |  | ||||||
|     // "moduleResolution": "node",            /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ |  | ||||||
|     // "baseUrl": "./",                       /* Base directory to resolve non-absolute module names. */ |  | ||||||
|     // "paths": {},                           /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ |  | ||||||
|     // "rootDirs": [],                        /* List of root folders whose combined content represents the structure of the project at runtime. */ |  | ||||||
|     // "typeRoots": [],                       /* List of folders to include type definitions from. */ |  | ||||||
|     // "types": [],                           /* Type declaration files to be included in compilation. */ |  | ||||||
|     // "allowSyntheticDefaultImports": true,  /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ |  | ||||||
|     "esModuleInterop": true                   /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ |  | ||||||
|     // "preserveSymlinks": true,              /* Do not resolve the real path of symlinks. */ |  | ||||||
|     // "allowUmdGlobalAccess": true,          /* Allow accessing UMD globals from modules. */ |  | ||||||
| 
 |  | ||||||
|     /* Source Map Options */ |  | ||||||
|     // "sourceRoot": "",                      /* Specify the location where debugger should locate TypeScript files instead of source locations. */ |  | ||||||
|     // "mapRoot": "",                         /* Specify the location where debugger should locate map files instead of generated locations. */ |  | ||||||
|     // "inlineSourceMap": true,               /* Emit a single file with source maps instead of having a separate file. */ |  | ||||||
|     // "inlineSources": true,                 /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ |  | ||||||
| 
 |  | ||||||
|     /* Experimental Options */ |  | ||||||
|     // "experimentalDecorators": true,        /* Enables experimental support for ES7 decorators. */ |  | ||||||
|     // "emitDecoratorMetadata": true,         /* Enables experimental support for emitting type metadata for decorators. */ |  | ||||||
|   }, |  | ||||||
|   "exclude": ["node_modules", "**/*.test.ts"] |  | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user