From 023ed35bb1746d15e9bfbca94c9e47b3ef7fe354 Mon Sep 17 00:00:00 2001 From: Jordan Tepper <12506217+HeroProtagonist@users.noreply.github.com> Date: Sat, 18 Jul 2026 15:50:50 -0400 Subject: [PATCH 01/13] Create github action mirroring circleci --- .github/workflows/ci.yml | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..51bad10 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: CI + +on: + push: + pull_request: + +jobs: + audit: + name: Audit NPM packages + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: lts/* + - run: corepack enable + - run: yarn audit --severity critical + + build: + name: Build library + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: yarn + - run: corepack enable + - run: yarn install + - run: yarn build + + test: + name: Test (${{ matrix.os }}, Node ${{ matrix.node-version }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + node-version: ['24', '26', '27'] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: yarn + - run: corepack enable + - run: yarn install + - run: yarn test:coverage + - run: yarn codecov + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 46b734c9e292f61e20d632653eeeb627f6d57ebb Mon Sep 17 00:00:00 2001 From: Jordan Tepper <12506217+HeroProtagonist@users.noreply.github.com> Date: Sat, 18 Jul 2026 16:08:52 -0400 Subject: [PATCH 02/13] Update action versions --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51bad10..03b9f54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,8 +9,8 @@ jobs: name: Audit NPM packages runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@v6 + - uses: actions/setup-node@v7 with: node-version: lts/* - run: corepack enable @@ -20,8 +20,8 @@ jobs: name: Build library runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@v6 + - uses: actions/setup-node@v7 with: node-version: lts/* cache: yarn @@ -38,8 +38,8 @@ jobs: os: [ubuntu-latest, macos-latest, windows-latest] node-version: ['24', '26', '27'] steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - uses: actions/checkout@v6 + - uses: actions/setup-node@v7 with: node-version: ${{ matrix.node-version }} cache: yarn From 005e5030f244ad92445c87b198bea5159c127a32 Mon Sep 17 00:00:00 2001 From: Jordan Tepper <12506217+HeroProtagonist@users.noreply.github.com> Date: Sat, 18 Jul 2026 16:11:08 -0400 Subject: [PATCH 03/13] Only run push on main --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03b9f54..7003702 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,7 @@ name: CI on: push: + branches: [main] pull_request: jobs: @@ -36,7 +37,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, macos-latest, windows-latest] - node-version: ['24', '26', '27'] + node-version: ['24', '26'] steps: - uses: actions/checkout@v6 - uses: actions/setup-node@v7 From d8fa145570908f14924085ed3158b8df94425236 Mon Sep 17 00:00:00 2001 From: Jordan Tepper <12506217+HeroProtagonist@users.noreply.github.com> Date: Sat, 18 Jul 2026 16:22:00 -0400 Subject: [PATCH 04/13] check existing node --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7003702..b1c8ada 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, macos-latest, windows-latest] - node-version: ['24', '26'] + node-version: ['16.14.2'] steps: - uses: actions/checkout@v6 - uses: actions/setup-node@v7 From 7c7349fe1e08125e2b2541fdbc6ac1226b953cd4 Mon Sep 17 00:00:00 2001 From: Jordan Tepper <12506217+HeroProtagonist@users.noreply.github.com> Date: Sat, 18 Jul 2026 16:22:26 -0400 Subject: [PATCH 05/13] remove circleci config --- .circleci/config.yml | 69 -------------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 214e6b1..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,69 +0,0 @@ -# https://circleci.com/docs/2.0/sample-config/#sample-configuration-with-sequential-workflow -# https://circleci.com/blog/circleci-matrix-jobs -version: 2.1 - -executors: - node: - docker: - - image: cimg/node:lts - linux: - docker: - - image: cimg/base:2020.01 - macos: - macos: - xcode: 12.5.1 - windows: - machine: - image: windows-server-2019-vs2019:stable - shell: bash.exe - resource_class: windows.medium - -orbs: - node: circleci/node@5.0.2 - -jobs: - audit: - executor: node - steps: - - checkout - - run: - name: Audit NPM packages - command: yarn audit --level critical - build: - executor: node - steps: - - checkout - - node/install-packages: - pkg-manager: yarn - - run: - name: Build library - command: yarn build - test: - parameters: - os: - type: executor - node-version: - type: string - executor: << parameters.os >> - steps: - - checkout - - node/install: - node-version: << parameters.node-version >> - install-yarn: true - - run: - name: Install packages - command: yarn install - - run: - name: Run tests - command: yarn test:coverage && yarn codecov - -workflows: - run-ci: - jobs: - - audit - - build - - test: - matrix: - parameters: - os: [linux, macos, windows] - node-version: ["16.14.2"] From 5ce042ed635dbbc63f8135ca0bc932aa61a1b78d Mon Sep 17 00:00:00 2001 From: Jordan Tepper <12506217+HeroProtagonist@users.noreply.github.com> Date: Sat, 18 Jul 2026 16:56:25 -0400 Subject: [PATCH 06/13] Update package.json --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 866f6ba..efa0eb2 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "1.5.0", "description": "Warn when using relative paths to modules aliased", "repository": "HeroProtagonist/eslint-plugin-module-resolver", + "packageManager": "yarn@4.17.1", "devEngines": { "runtime": { "name": "node", From 329fdcf7ef9fe031a81958aa45632629c8a33704 Mon Sep 17 00:00:00 2001 From: Jordan Tepper <12506217+HeroProtagonist@users.noreply.github.com> Date: Sat, 18 Jul 2026 17:02:32 -0400 Subject: [PATCH 07/13] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1c8ada..4c39993 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, macos-latest, windows-latest] - node-version: ['16.14.2'] + node-version: ['16.9'] steps: - uses: actions/checkout@v6 - uses: actions/setup-node@v7 From 9c019ae337b199ed02b7964fba669aefb8f542e4 Mon Sep 17 00:00:00 2001 From: Jordan Tepper <12506217+HeroProtagonist@users.noreply.github.com> Date: Sat, 18 Jul 2026 17:07:36 -0400 Subject: [PATCH 08/13] Enable corepack before cache --- .github/workflows/ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c39993..351c646 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: CI on: push: - branches: [main] + branches: [main] pull_request: jobs: @@ -11,10 +11,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 + - run: corepack enable - uses: actions/setup-node@v7 with: node-version: lts/* - - run: corepack enable + cache: yarn + - run: yarn install - run: yarn audit --severity critical build: @@ -22,11 +24,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 + - run: corepack enable - uses: actions/setup-node@v7 with: node-version: lts/* cache: yarn - - run: corepack enable - run: yarn install - run: yarn build @@ -40,11 +42,11 @@ jobs: node-version: ['16.9'] steps: - uses: actions/checkout@v6 + - run: corepack enable - uses: actions/setup-node@v7 with: node-version: ${{ matrix.node-version }} cache: yarn - - run: corepack enable - run: yarn install - run: yarn test:coverage - run: yarn codecov From 3f8c6f3627bbb49d3bca5a04e175268503d66a6e Mon Sep 17 00:00:00 2001 From: Jordan Tepper <12506217+HeroProtagonist@users.noreply.github.com> Date: Sat, 18 Jul 2026 17:10:23 -0400 Subject: [PATCH 09/13] Update ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 351c646..1156d50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: node-version: lts/* cache: yarn - run: yarn install - - run: yarn audit --severity critical + - run: yarn npm audit --severity critical build: name: Build library @@ -39,7 +39,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, macos-latest, windows-latest] - node-version: ['16.9'] + node-version: ['22', '24'] steps: - uses: actions/checkout@v6 - run: corepack enable From ec1d28888e9645cca02bf81fe9ac43ebe9281aa0 Mon Sep 17 00:00:00 2001 From: Jordan Tepper <12506217+HeroProtagonist@users.noreply.github.com> Date: Sat, 18 Jul 2026 17:15:11 -0400 Subject: [PATCH 10/13] Update ci.yml --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1156d50..039bfed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,9 @@ jobs: node-version: ['22', '24'] steps: - uses: actions/checkout@v6 + - uses: actions/setup-node@v7 + with: + node-version: ${{ matrix.node-version }} - run: corepack enable - uses: actions/setup-node@v7 with: From e06d5a3cc8bd7918aaf202dd3250213b6051eebe Mon Sep 17 00:00:00 2001 From: Jordan Tepper <12506217+HeroProtagonist@users.noreply.github.com> Date: Sat, 18 Jul 2026 17:50:37 -0400 Subject: [PATCH 11/13] Fix issue with `create-fixer` on windows --- lib/helpers/create-fixer.js | 6 +++--- lib/rules/use-alias.js | 18 ++++++------------ 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/lib/helpers/create-fixer.js b/lib/helpers/create-fixer.js index 4bb6bec..80530d3 100644 --- a/lib/helpers/create-fixer.js +++ b/lib/helpers/create-fixer.js @@ -13,15 +13,15 @@ const createFixer = (options = {}) => { if (!source) return null - const aliasPaths = entries(alias).map(([key, value]) => [key, path.join(cwd, value)]) + const aliasPaths = entries(alias).map(([key, value]) => [key, path.resolve(cwd, value)]) const resolvedPath = path.resolve(filePath, source.value) const [aliasMatch, aliasPath] = aliasPaths.find(([_, aliasPath]) => isAliasPath(resolvedPath, aliasPath)) || [] if (!aliasMatch || !aliasPath) return null - const newPath = resolvedPath.replace(aliasPath, '') + const newPath = path.relative(aliasPath, resolvedPath) - const replacement = path.normalize(path.join(aliasMatch, newPath)).replace(/\\/g, '/').replace(/\/c:/gi, '') + const replacement = path.normalize(path.join(aliasMatch, newPath)).replace(/\\/g, '/') return (fixer) => fixer.replaceTextRange([source.range[0] + 1, source.range[1] - 1], replacement) } diff --git a/lib/rules/use-alias.js b/lib/rules/use-alias.js index 4e4af31..c208823 100644 --- a/lib/rules/use-alias.js +++ b/lib/rules/use-alias.js @@ -102,17 +102,15 @@ module.exports = { // Build array of alias paths. const cwd = projectRootAbsolutePath || process.cwd() - const aliasPaths = values(alias).map((a) => path.join(cwd, a)) + const aliasPaths = values(alias).map((a) => path.resolve(cwd, a)) const hasError = (val) => { if (!val) return false // template literals will have undefined val const { ignoreDepth, projectRoot, extensions, allowDepthMoreOrLessThanEquality } = options - let {chainedExtensions = []} = options; + let { chainedExtensions = [] } = options // Be forgiving if the config provides "ext" or ".ext" - chainedExtensions = chainedExtensions.map( - ext => ext.startsWith('.') ? ext : `.${ext}` - ); + chainedExtensions = chainedExtensions.map((ext) => (ext.startsWith('.') ? ext : `.${ext}`)) // Ignore if directory depth matches options. if (checkIgnoreDepth({ ignoreDepth, path: val, allowDepthMoreOrLessThanEquality })) return false @@ -126,12 +124,10 @@ module.exports = { } const resolvedPath = path.resolve(filePath, val) - const pathExt = path.extname(val); + const pathExt = path.extname(val) // If no extension is present, or if the extension is explicitly // allowlisted as chainable, resolve the extension to a `.js` file. - const resolvedExt = !pathExt || chainedExtensions.includes(pathExt) - ? '.js' - : '' + const resolvedExt = !pathExt || chainedExtensions.includes(pathExt) ? '.js' : '' let pathExists = checkPath(resolvedPath, resolvedExt) @@ -139,9 +135,7 @@ module.exports = { pathExists = extensions.filter((ext) => checkPath(resolvedPath, ext)).length } - const isAliased = aliasPaths.some((aliasPath) => - isAliasPath(resolvedPath, aliasPath) - ) + const isAliased = aliasPaths.some((aliasPath) => isAliasPath(resolvedPath, aliasPath)) const error = isAliased && pathExists && val.match(/\.\.\//) // matches, exists, and starts with ../, return error && { suggestFix: true, message: 'Do not use relative path for aliased modules' } From 4d5521c44e21a073db59efecb474181d9e4cba8b Mon Sep 17 00:00:00 2001 From: Jordan Tepper <12506217+HeroProtagonist@users.noreply.github.com> Date: Sat, 18 Jul 2026 18:14:32 -0400 Subject: [PATCH 12/13] Replace ci badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e25bd7c..5c8c968 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![npm version](https://badge.fury.io/js/eslint-plugin-module-resolver.svg)](https://badge.fury.io/js/eslint-plugin-module-resolver) [![npm downloads](https://img.shields.io/npm/dm/eslint-plugin-module-resolver.svg)](https://www.npmjs.com/package/eslint-plugin-module-resolver) -[![CircleCI](https://circleci.com/gh/HeroProtagonist/eslint-plugin-module-resolver.svg?style=shield)](https://app.circleci.com/pipelines/github/HeroProtagonist/eslint-plugin-module-resolver) +[![GitHub Actions CI Workflow Status](https://github.com/HeroProtagonist/eslint-plugin-module-resolver/actions/workflows/ci.yml/badge.svg)](https://github.com/HeroProtagonist/eslint-plugin-module-resolver/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/HeroProtagonist/eslint-plugin-module-resolver/branch/master/graph/badge.svg)](https://codecov.io/gh/HeroProtagonist/eslint-plugin-module-resolver) Warn when using relative paths to modules aliased using [babel-plugin-module-resolver](https://github.com/tleunen/babel-plugin-module-resolver) From 62f027337410d3f15ada401afe6e8d14edbd63b9 Mon Sep 17 00:00:00 2001 From: Jordan Tepper <12506217+HeroProtagonist@users.noreply.github.com> Date: Sat, 18 Jul 2026 18:15:06 -0400 Subject: [PATCH 13/13] Run `yarn format` --- tests/babelrc.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/babelrc.js b/tests/babelrc.js index bcdb406..035c6a3 100644 --- a/tests/babelrc.js +++ b/tests/babelrc.js @@ -3,7 +3,7 @@ module.exports = { plugins: [ { file: { - request: 'babel-plugin-module-resolver' + request: 'babel-plugin-module-resolver', }, options: { root: ['.'], @@ -13,7 +13,7 @@ module.exports = { lib: './lib', ClientMain: './src/client/main', }, - } - } - ] + }, + }, + ], }