diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index a07fac2..a494867 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -57,8 +57,9 @@ jobs: - name: Security audit run: npm run security - - name: Check commit message - uses: wagoid/commitlint-github-action@v5 + - name: Validate PR commits with commitlint + if: github.event_name == 'pull_request' + run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose test: name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }} diff --git a/src/index.js b/src/index.js index 623d1bc..4e2c0ae 100644 --- a/src/index.js +++ b/src/index.js @@ -64,9 +64,9 @@ const schema = require("./options.json"); /** * @template T * @typedef {Object} BasePluginOptions - * @property {Rule} [test] - * @property {Rule} [include] - * @property {Rule} [exclude] + * @property {Rules} [test] + * @property {Rules} [include] + * @property {Rules} [exclude] * @property {number} [threshold] * @property {number} [minRatio] * @property {DeleteOriginalAssets} [deleteOriginalAssets] diff --git a/types/index.d.ts b/types/index.d.ts index ab54cf6..09ab8c0 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -43,9 +43,9 @@ export = CompressionPlugin; /** * @template T * @typedef {Object} BasePluginOptions - * @property {Rule} [test] - * @property {Rule} [include] - * @property {Rule} [exclude] + * @property {Rules} [test] + * @property {Rules} [include] + * @property {Rules} [exclude] * @property {number} [threshold] * @property {number} [minRatio] * @property {DeleteOriginalAssets} [deleteOriginalAssets] @@ -182,9 +182,9 @@ type PathData = { type Filename = string | ((fileData: PathData) => string); type DeleteOriginalAssets = boolean | "keep-source-map"; type BasePluginOptions = { - test?: Rule | undefined; - include?: Rule | undefined; - exclude?: Rule | undefined; + test?: Rules | undefined; + include?: Rules | undefined; + exclude?: Rules | undefined; threshold?: number | undefined; minRatio?: number | undefined; deleteOriginalAssets?: DeleteOriginalAssets | undefined;