├── .editorconfig ├── .gitattributes ├── .github ├── dependabot.yml └── workflows │ ├── ci.yml │ ├── codeql-analysis.yml │ ├── dependabot-auto-merge.yml │ └── fixup-commits.yml ├── .gitignore ├── .vscode └── settings.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── __tests__ ├── problemMatcher.test.ts └── utils.ts ├── action.yml ├── docs ├── annotations.png └── build-log.png ├── jest.config.cjs ├── package-lock.json ├── package.json ├── src ├── main.ts └── problem-matcher.json ├── tsconfig.build.json └── tsconfig.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | insert_final_newline = true 6 | indent_size = 4 7 | indent_style = space 8 | trim_trailing_whitespace = true 9 | 10 | [*.{js,cjs,ts}] 11 | end_of_line = lf 12 | indent_size = 2 13 | 14 | [*.json] 15 | end_of_line = lf 16 | indent_size = 2 17 | 18 | [*.yml] 19 | indent_size = 2 20 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | *.js text eol=lf 5 | *.cjs text eol=lf 6 | *.ts text eol=lf 7 | 8 | *.json text eol=lf 9 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | 4 | - package-ecosystem: github-actions 5 | directory: "/" 6 | schedule: 7 | interval: weekly 8 | open-pull-requests-limit: 99 9 | 10 | - package-ecosystem: npm 11 | directory: "/" 12 | schedule: 13 | interval: weekly 14 | open-pull-requests-limit: 99 15 | versioning-strategy: increase 16 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | pull_request: 5 | push: 6 | branches: 7 | - main 8 | 9 | concurrency: 10 | group: ${{ github.workflow }}-${{ github.ref }} 11 | cancel-in-progress: true 12 | 13 | env: 14 | FORCE_COLOR: 3 15 | 16 | jobs: 17 | build: 18 | runs-on: ubuntu-latest 19 | 20 | strategy: 21 | fail-fast: false 22 | matrix: 23 | node: [16, 18] 24 | 25 | steps: 26 | - name: Checkout Repo 27 | uses: actions/checkout@v4.2.2 28 | 29 | - name: Install Node 30 | uses: actions/setup-node@v4.4.0 31 | with: 32 | node-version: ${{ matrix.node }} 33 | 34 | - run: npm ci 35 | 36 | - run: npm run lint 37 | 38 | - run: npm test 39 | 40 | - run: npm run build 41 | 42 | - run: npm run package 43 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | schedule: 9 | - cron: '23 21 * * 5' 10 | 11 | concurrency: 12 | group: ${{ github.workflow }}-${{ github.ref }} 13 | cancel-in-progress: true 14 | 15 | env: 16 | FORCE_COLOR: 3 17 | 18 | jobs: 19 | analyze: 20 | name: Analyze 21 | 22 | runs-on: ubuntu-latest 23 | 24 | permissions: 25 | actions: read 26 | contents: read 27 | security-events: write 28 | 29 | strategy: 30 | fail-fast: false 31 | matrix: 32 | language: [ 'javascript' ] 33 | 34 | steps: 35 | - name: Checkout repository 36 | uses: actions/checkout@v4.2.2 37 | 38 | - name: Initialize CodeQL 39 | uses: github/codeql-action/init@v3 40 | with: 41 | languages: ${{ matrix.language }} 42 | 43 | - name: Autobuild 44 | uses: github/codeql-action/autobuild@v3 45 | 46 | - name: Perform CodeQL Analysis 47 | uses: github/codeql-action/analyze@v3 48 | -------------------------------------------------------------------------------- /.github/workflows/dependabot-auto-merge.yml: -------------------------------------------------------------------------------- 1 | name: Dependabot auto-merge 2 | 3 | on: pull_request_target 4 | 5 | permissions: 6 | contents: read 7 | pull-requests: read 8 | 9 | jobs: 10 | dependabot: 11 | uses: xt0rted/.github/.github/workflows/dependabot-auto-merge.yml@main 12 | secrets: 13 | GITHUB_APP_ID: ${{ secrets.DEPENDAMERGE_APP_ID }} 14 | GITHUB_APP_PRIVATE_KEY: ${{ secrets.DEPENDAMERGE_PRIVATE_KEY }} 15 | -------------------------------------------------------------------------------- /.github/workflows/fixup-commits.yml: -------------------------------------------------------------------------------- 1 | name: Block on fixup commits 2 | 3 | on: pull_request_target 4 | 5 | permissions: 6 | pull-requests: read 7 | 8 | jobs: 9 | message: 10 | uses: xt0rted/.github/.github/workflows/fixup-commits.yml@main 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | __tests__/runner/* 2 | 3 | dist/ 4 | 5 | node_modules/ 6 | lib/ 7 | 8 | # Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore 9 | # Logs 10 | logs 11 | *.log 12 | npm-debug.log* 13 | yarn-debug.log* 14 | yarn-error.log* 15 | lerna-debug.log* 16 | 17 | # Diagnostic reports (https://nodejs.org/api/report.html) 18 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 19 | 20 | # Runtime data 21 | pids 22 | *.pid 23 | *.seed 24 | *.pid.lock 25 | 26 | # Directory for instrumented libs generated by jscoverage/JSCover 27 | lib-cov 28 | 29 | # Coverage directory used by tools like istanbul 30 | coverage 31 | *.lcov 32 | 33 | # nyc test coverage 34 | .nyc_output 35 | 36 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 37 | .grunt 38 | 39 | # Bower dependency directory (https://bower.io/) 40 | bower_components 41 | 42 | # node-waf configuration 43 | .lock-wscript 44 | 45 | # Compiled binary addons (https://nodejs.org/api/addons.html) 46 | build/Release 47 | 48 | # Dependency directories 49 | jspm_packages/ 50 | 51 | # TypeScript v1 declaration files 52 | typings/ 53 | 54 | # TypeScript cache 55 | *.tsbuildinfo 56 | 57 | # Optional npm cache directory 58 | .npm 59 | 60 | # Optional eslint cache 61 | .eslintcache 62 | 63 | # Optional REPL history 64 | .node_repl_history 65 | 66 | # Output of 'npm pack' 67 | *.tgz 68 | 69 | # Yarn Integrity file 70 | .yarn-integrity 71 | 72 | # dotenv environment variables file 73 | .env 74 | .env.test 75 | 76 | # parcel-bundler cache (https://parceljs.org/) 77 | .cache 78 | 79 | # next.js build output 80 | .next 81 | 82 | # nuxt.js build output 83 | .nuxt 84 | 85 | # vuepress build output 86 | .vuepress/dist 87 | 88 | # Serverless directories 89 | .serverless/ 90 | 91 | # FuseBox cache 92 | .fusebox/ 93 | 94 | # DynamoDB Local files 95 | .dynamodb/ 96 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": [ 3 | "dependabot", 4 | "promisify", 5 | "stylelint" 6 | ], 7 | // This makes sure we use the system version of node, not the vs code version 8 | "eslint.runtime": "node", 9 | "jest.jestCommandLine": "node --experimental-vm-modules node_modules/jest/bin/jest.js", 10 | "jestrunner.jestCommand": "node --experimental-vm-modules node_modules/jest/bin/jest.js", 11 | "typescript.tsdk": "node_modules\\typescript\\lib", 12 | } 13 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## Unreleased 4 | 5 | - Bumped `@actions/core` from 1.7.0 to 1.10.0 6 | - Updated to run on Node 16 7 | - Converted to es modules 8 | 9 | ## [1.3.0](https://github.com/xt0rted/stylelint-problem-matcher/compare/v1.2.0...v1.3.0) - 2022-04-28 10 | 11 | - Bumped `@actions/core` from 1.2.2 to 1.7.0 12 | 13 | ## [1.2.0](https://github.com/xt0rted/stylelint-problem-matcher/compare/v1.1.0...v1.2.0) - 2020-02-18 14 | 15 | - Pulling owner name from problem matcher file when removing it 16 | 17 | ## [1.1.0](https://github.com/xt0rted/stylelint-problem-matcher/compare/v1.0.0...v1.1.0) - 2020-02-04 18 | 19 | - Updated problem matcher regex to handle rules without line numbers such as [`unicode-bom`](https://stylelint.io/user-guide/rules/unicode-bom) ([#2](https://github.com/xt0rted/stylelint-problem-matcher/pull/2)) 20 | 21 | ## [1.0.0](https://github.com/xt0rted/stylelint-problem-matcher/releases/tag/v1.0.0) - 2020-02-03 22 | 23 | - Initial release 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Brian Surowiec 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Problem Matcher for stylelint 2 | 3 | [![CI](https://github.com/xt0rted/stylelint-problem-matcher/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/xt0rted/stylelint-problem-matcher/actions/workflows/ci.yml) 4 | [![CodeQL](https://github.com/xt0rted/stylelint-problem-matcher/actions/workflows/codeql-analysis.yml/badge.svg?branch=main)](https://github.com/xt0rted/stylelint-problem-matcher/actions/workflows/codeql-analysis.yml) 5 | 6 | Adds a problem matcher that will detect errors from [Stylelint](https://stylelint.io/) and create annotations for them. 7 | 8 | ## Usage 9 | 10 | ```yml 11 | on: push 12 | jobs: 13 | build: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v3 17 | - uses: actions/setup-node@v2 18 | with: 19 | node-version: 16 20 | - uses: xt0rted/stylelint-problem-matcher@v1 21 | - run: npm ci 22 | - run: npm test 23 | ``` 24 | 25 | ![Example of inline annotations](docs/annotations.png) 26 | 27 | ![Example of build log with highlighted errors](docs/build-log.png) 28 | 29 | ## Options 30 | 31 | Name | Allowed values | Description 32 | -- | -- | -- 33 | `action` | `add` (default), `remove` | If the problem matcher should be registered or removed 34 | 35 | ## Using with sub folders 36 | 37 | If you're running Stylelint from a sub folder, or using the [`working-directory`](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsrun) option on your build step, you'll need to switch your report formatter to [stylelint-actions-formatters](https://github.com/xt0rted/stylelint-actions-formatters). 38 | This package is a copy of the formatters that Stylelint ships with (`string` and `verbose`) but they're modified so the file paths are rooted to [`GITHUB_WORKSPACE`](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-variables#default-environment-variables) instead of your subfolder. 39 | Without this change the actions runner won't be able to associate the annotations with the correct file. 40 | 41 | ### package.json 42 | 43 | ```json 44 | { 45 | "scripts": { 46 | "test": "stylelint \"scss/**/*.scss\" --custom-formatter=node_modules/stylelint-actions-formatters" 47 | } 48 | } 49 | ``` 50 | 51 | ### ci.yml 52 | 53 | ```yml 54 | on: push 55 | jobs: 56 | build: 57 | runs-on: ubuntu-latest 58 | steps: 59 | - uses: actions/checkout@v3 60 | - uses: actions/setup-node@v2 61 | with: 62 | node-version: 16 63 | - uses: xt0rted/stylelint-problem-matcher@v1 64 | - run: npm ci 65 | working-directory: "src/website" 66 | - run: npm test 67 | working-directory: "src/website" 68 | ``` 69 | 70 | ## License 71 | 72 | The scripts and documentation in this project are released under the [MIT License](LICENSE) 73 | -------------------------------------------------------------------------------- /__tests__/problemMatcher.test.ts: -------------------------------------------------------------------------------- 1 | import { readFile } from "node:fs/promises"; 2 | import { fileURLToPath } from "node:url"; 3 | 4 | import { matchResults } from "./utils"; 5 | 6 | import type { 7 | ProblemMatcher, 8 | ProblemMatcherDocument, 9 | ProblemPattern, 10 | } from "github-actions-problem-matcher-typings"; 11 | 12 | describe("problemMatcher", () => { 13 | let problemMatcher: ProblemMatcher; 14 | 15 | beforeAll(async () => { 16 | const matcherFile = fileURLToPath(new URL("../src/problem-matcher.json", import.meta.url)); 17 | const fileContents = await readFile(matcherFile, { encoding: "utf8" }); 18 | const problemMatcherDocument = JSON.parse(fileContents) as ProblemMatcherDocument; 19 | 20 | problemMatcher = problemMatcherDocument.problemMatcher[0]; 21 | }); 22 | 23 | it("has the correct owner", () => { 24 | expect(problemMatcher.owner).toEqual("stylelint"); 25 | }); 26 | 27 | it("has two patterns", () => { 28 | expect(problemMatcher.pattern.length).toEqual(2); 29 | }); 30 | 31 | describe("file pattern", () => { 32 | let pattern: ProblemPattern; 33 | let regexp: RegExp; 34 | 35 | beforeEach(() => { 36 | pattern = problemMatcher.pattern[0]; 37 | regexp = new RegExp(pattern.regexp); 38 | }); 39 | 40 | it("matches file path", () => { 41 | const reportOutput = [ 42 | "scss/_test.scss", 43 | " 11:16 × Unexpected unit length-zero-no-unit", 44 | " 11:28 × Unexpected unit length-zero-no-unit", 45 | ]; 46 | 47 | const results = matchResults(reportOutput, regexp); 48 | 49 | expect(results.length).toEqual(1); 50 | expect(results[0][pattern.file!]).toEqual("scss/_test.scss"); 51 | }); 52 | }); 53 | 54 | describe("violation pattern", () => { 55 | let pattern: ProblemPattern; 56 | let regexp: RegExp; 57 | 58 | beforeEach(() => { 59 | pattern = problemMatcher.pattern[1]; 60 | regexp = new RegExp(pattern.regexp); 61 | }); 62 | 63 | it("matches violations", () => { 64 | const reportOutput = [ 65 | "scss/_test.scss", 66 | " 11:16 × Unexpected unit length-zero-no-unit", 67 | " 11:28 × Unexpected unit length-zero-no-unit", 68 | ]; 69 | 70 | const results = matchResults(reportOutput, regexp); 71 | 72 | expect(results.length).toEqual(2); 73 | }); 74 | 75 | it("matches violations without line numbers", () => { 76 | const reportOutput = [ 77 | "scss/_test.scss", 78 | " × Unexpected Unicode BOM unicode-bom", 79 | " 11:16 × Unexpected unit length-zero-no-unit", 80 | " 11:28 × Unexpected unit length-zero-no-unit", 81 | ]; 82 | 83 | const results = matchResults(reportOutput, regexp); 84 | 85 | expect(results.length).toEqual(3); 86 | }); 87 | 88 | it("matches violation details", () => { 89 | const reportOutput = [ 90 | "scss/_test.scss", 91 | " 11:16 × Unexpected unit length-zero-no-unit", 92 | ]; 93 | 94 | const results = matchResults(reportOutput, regexp); 95 | 96 | expect(results.length).toEqual(1); 97 | expect(results[0][pattern.line!]).toEqual("11"); 98 | expect(results[0][pattern.column!]).toEqual("16"); 99 | expect(results[0][pattern.message!]).toEqual("Unexpected unit "); 100 | expect(results[0][pattern.code!]).toEqual("length-zero-no-unit"); 101 | }); 102 | }); 103 | }); 104 | -------------------------------------------------------------------------------- /__tests__/utils.ts: -------------------------------------------------------------------------------- 1 | function notEmpty(value: TValue | null | undefined): value is TValue { 2 | return value !== null && value !== undefined; 3 | } 4 | 5 | export function matchResults(report: string[], regexp: RegExp): RegExpExecArray[] { 6 | return report 7 | .map(line => regexp.exec(line)) 8 | .filter(notEmpty); 9 | } 10 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: "Problem Matcher for stylelint" 2 | 3 | description: "Sets up a problem matcher for stylelint that's used to create annotations for violations" 4 | 5 | author: "xt0rted" 6 | 7 | branding: 8 | icon: "command" 9 | color: "green" 10 | 11 | inputs: 12 | action: 13 | description: "The action to take on the problem matcher (add or remove)" 14 | required: false 15 | default: add 16 | 17 | runs: 18 | using: "node16" 19 | main: "dist/index.js" 20 | -------------------------------------------------------------------------------- /docs/annotations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xt0rted/stylelint-problem-matcher/e997643efb2c7a8f96c5c828c2496fd59e0ca3f2/docs/annotations.png -------------------------------------------------------------------------------- /docs/build-log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xt0rted/stylelint-problem-matcher/e997643efb2c7a8f96c5c828c2496fd59e0ca3f2/docs/build-log.png -------------------------------------------------------------------------------- /jest.config.cjs: -------------------------------------------------------------------------------- 1 | /** @type {import("ts-jest/dist/types").InitialOptionsTsJest} */ 2 | module.exports = { 3 | clearMocks: true, 4 | globals: { "ts-jest": { useESM: true } }, 5 | moduleNameMapper: { "^(\\.{1,2}/.*)\\.js$": "$1" }, 6 | reporters: ["default", "github-actions"], 7 | preset: "ts-jest/presets/default-esm", 8 | resetMocks: true, 9 | testEnvironment: "node", 10 | testMatch: ["**/*.test.ts"], 11 | testRunner: "jest-circus/runner", 12 | verbose: true, 13 | }; 14 | 15 | const processStdoutWrite = process.stdout.write.bind(process.stdout); 16 | 17 | process.stdout.write = (string_, encoding, callback) => { 18 | if (!String(string_).startsWith("::")) { 19 | return processStdoutWrite(string_, encoding, callback); 20 | } 21 | }; 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stylelint-problem-matcher", 3 | "version": "1.0.0", 4 | "private": true, 5 | "description": "Sets up a problem matcher for stylelint that's used to create annotations for violations", 6 | "main": "dist/index.js", 7 | "type": "module", 8 | "scripts": { 9 | "build": "tsc --project ./tsconfig.build.json", 10 | "lint": "tsc --noEmit", 11 | "package": "ncc build src/main.ts", 12 | "release": "npm run package && git add -f dist/", 13 | "test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest --coverage" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/xt0rted/dotnet-format-linter-action.git" 18 | }, 19 | "keywords": [ 20 | "actions", 21 | "github", 22 | "problem-matcher", 23 | "annotations" 24 | ], 25 | "author": "xt0rted", 26 | "license": "MIT", 27 | "dependencies": { 28 | "@actions/core": "^1.10.1" 29 | }, 30 | "devDependencies": { 31 | "@types/jest": "^28.1.7", 32 | "@types/node": "^22.15.29", 33 | "@vercel/ncc": "^0.38.3", 34 | "cross-env": "^7.0.3", 35 | "github-actions-problem-matcher-typings": "^1.1.0", 36 | "jest": "^28.1.3", 37 | "jest-circus": "^29.7.0", 38 | "ts-jest": "^28.0.8", 39 | "tslib": "^2.8.1", 40 | "typescript": "^5.8.3" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { readFile } from "node:fs/promises"; 2 | import { fileURLToPath } from "node:url"; 3 | 4 | import { 5 | getInput, 6 | setFailed, 7 | } from "@actions/core"; 8 | import { issueCommand } from "@actions/core/lib/command" 9 | 10 | import type { ProblemMatcherDocument } from "github-actions-problem-matcher-typings"; 11 | 12 | export async function run(): Promise { 13 | try { 14 | const action = getInput("action"); 15 | 16 | const matcherFile = fileURLToPath(new URL("problem-matcher.json", import.meta.url)); 17 | 18 | switch (action) { 19 | case "add": 20 | issueCommand( 21 | "add-matcher", 22 | {}, 23 | matcherFile, 24 | ); 25 | break; 26 | 27 | case "remove": 28 | const fileContents = await readFile(matcherFile, { encoding: "utf8" }); 29 | const problemMatcherDocument: ProblemMatcherDocument = JSON.parse(fileContents); 30 | const problemMatcher = problemMatcherDocument.problemMatcher[0]; 31 | 32 | issueCommand( 33 | "remove-matcher", 34 | { 35 | owner: problemMatcher.owner, 36 | }, 37 | "", 38 | ); 39 | break; 40 | 41 | default: 42 | throw Error(`Unsupported action "${action}"`); 43 | } 44 | } catch (error) { 45 | if (error instanceof Error) { 46 | setFailed(error.message); 47 | } else { 48 | throw error; 49 | } 50 | } 51 | } 52 | 53 | run(); 54 | -------------------------------------------------------------------------------- /src/problem-matcher.json: -------------------------------------------------------------------------------- 1 | { 2 | "problemMatcher": [ 3 | { 4 | "owner": "stylelint", 5 | "pattern": [ 6 | { 7 | "regexp": "^([^\\s].*)$", 8 | "file": 1 9 | }, 10 | { 11 | "regexp": "^\\s+((\\d+):(\\d+))?\\s+(✖|×)\\s+(.*)\\s{3,}(.*)$", 12 | "line": 2, 13 | "column": 3, 14 | "message": 5, 15 | "code": 6, 16 | "loop": true 17 | } 18 | ] 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "exclude": [ 4 | "**/*.test.ts" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | /* Basic Options */ 4 | // "incremental": true, /* Enable incremental compilation */ 5 | "target": "ES2021", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ 6 | "module": "ESNext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ 7 | // "allowJs": true, /* Allow javascript files to be compiled. */ 8 | // "checkJs": true, /* Report errors in .js files. */ 9 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ 10 | // "declaration": true, /* Generates corresponding '.d.ts' file. */ 11 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ 12 | // "sourceMap": true, /* Generates corresponding '.map' file. */ 13 | // "outFile": "./", /* Concatenate and emit output to single file. */ 14 | "outDir": "./lib", /* Redirect output structure to the directory. */ 15 | // "rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */ 16 | // "composite": true, /* Enable project compilation */ 17 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ 18 | // "removeComments": true, /* Do not emit comments to output. */ 19 | // "noEmit": true, /* Do not emit outputs. */ 20 | "importHelpers": true, /* Import emit helpers from 'tslib'. */ 21 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ 22 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ 23 | "forceConsistentCasingInFileNames": true, 24 | 25 | /* Strict Type-Checking Options */ 26 | "strict": true, /* Enable all strict type-checking options. */ 27 | "noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */ 28 | // "strictNullChecks": true, /* Enable strict null checks. */ 29 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */ 30 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ 31 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ 32 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ 33 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ 34 | 35 | /* Additional Checks */ 36 | // "noUnusedLocals": true, /* Report errors on unused locals. */ 37 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 38 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 39 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 40 | 41 | /* Module Resolution Options */ 42 | "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ 43 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ 44 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ 45 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ 46 | // "typeRoots": [], /* List of folders to include type definitions from. */ 47 | // "types": [], /* Type declaration files to be included in compilation. */ 48 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ 49 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ 50 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ 51 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ 52 | "resolveJsonModule": true, /* Allows for importing .json files as modules. */ 53 | 54 | /* Source Map Options */ 55 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ 56 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ 57 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ 58 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ 59 | 60 | /* Experimental Options */ 61 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ 62 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ 63 | }, 64 | "exclude": [ 65 | "node_modules" 66 | ] 67 | } 68 | --------------------------------------------------------------------------------