From 95cdb2291e26f201c9090a3e7e8cf6b050fbd4e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 17:03:06 +0300 Subject: [PATCH 1/2] Bump github/codeql-action from 2 to 3 (#126) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v2...v3) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c090036..0a2f4fa 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -29,16 +29,16 @@ jobs: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: config-file: ./.github/codeql/codeql-config.yml languages: "javascript" queries: +security-and-quality - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 with: category: "/language:javascript" From 29fec2c997c590d7f2d74974adbdae2e5d02c932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sampo=20Kivist=C3=B6?= <2021355+Havunen@users.noreply.github.com> Date: Thu, 4 Apr 2024 21:22:48 +0300 Subject: [PATCH 2/2] Add support for vue single file components (#111) --- index.js | 34 +++++++++++++++++++++++++++++++++- test/test.js | 3 ++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index d5e7924..895bde9 100644 --- a/index.js +++ b/index.js @@ -32,7 +32,8 @@ const defaultLookups = { '.scss': sassLookup, '.styl': stylusLookup, '.ts': tsLookup, - '.tsx': tsLookup + '.tsx': tsLookup, + '.vue': vueLookup }; /** @@ -389,6 +390,37 @@ function commonJSLookup(options) { return result; } +function vueLookup(options) { + const { dependency } = options; + + if (!dependency) { + debug('blank dependency given. Returning early.'); + return ''; + } + + if (dependency.endsWith('.js') || dependency.endsWith('.jsx')) { + return jsLookup(options); + } + + if (dependency.endsWith('.ts') || dependency.endsWith('.tsx')) { + return tsLookup(options); + } + + if (dependency.endsWith('.scss') || dependency.endsWith('.sass') || dependency.endsWith('.less')) { + return sassLookup(options); + } + + if (dependency.endsWith('.styl')) { + return stylusLookup(options); + } + + if (options.tsConfig || options.tsConfigPath) { + return tsLookup(options); + } + + return jsLookup(options); +} + function resolveWebpackPath({ dependency, filename, directory, webpackConfig }) { if (!webpackResolve) { webpackResolve = require('enhanced-resolve'); diff --git a/test/test.js b/test/test.js index d1254c2..6bca2b5 100644 --- a/test/test.js +++ b/test/test.js @@ -21,7 +21,8 @@ describe('filing-cabinet', () => { '.scss', '.styl', '.ts', - '.tsx' + '.tsx', + '.vue' ].sort(); assert.deepEqual(actual, expected); });