Skip to content

feat(rule): implement import/no-webpack-loader-syntax#339

Merged
hardfist merged 2 commits intoweb-infra-dev:mainfrom
Thiry1:feat/no-webpack-loader-syntax
Sep 9, 2025
Merged

feat(rule): implement import/no-webpack-loader-syntax#339
hardfist merged 2 commits intoweb-infra-dev:mainfrom
Thiry1:feat/no-webpack-loader-syntax

Conversation

@Thiry1
Copy link
Copy Markdown
Contributor

@Thiry1 Thiry1 commented Sep 5, 2025

Summary

implement import/no-webpack-loader-syntax

Related Links

#181

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@netlify
Copy link
Copy Markdown

netlify bot commented Sep 5, 2025

Deploy Preview for rslint ready!

Name Link
🔨 Latest commit 7a77301
🔍 Latest deploy log https://app.netlify.com/projects/rslint/deploys/68bfd00a8089250008746012
😎 Deploy Preview https://deploy-preview-339--rslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Thiry1
Copy link
Copy Markdown
Contributor Author

Thiry1 commented Sep 5, 2025

The CI seems to have failed, so I'll set it to draft and check it later.

@Thiry1 Thiry1 marked this pull request as draft September 5, 2025 11:36
@Thiry1 Thiry1 force-pushed the feat/no-webpack-loader-syntax branch from 38990f8 to 058fda7 Compare September 5, 2025 16:58
@Thiry1 Thiry1 marked this pull request as ready for review September 6, 2025 02:39
@hardfist
Copy link
Copy Markdown
Contributor

hardfist commented Sep 9, 2025

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

@hardfist hardfist requested a review from Copilot September 9, 2025 06:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements the import/no-webpack-loader-syntax rule to detect and prevent the use of webpack loader syntax in import statements. The rule flags any import or require statement that contains a '!' character, which is used in webpack to specify loaders.

  • Adds a new rule implementation in Go that detects webpack loader syntax in both import declarations and require calls
  • Adds comprehensive test coverage for both valid and invalid cases
  • Integrates the rule into the plugin's rule registry

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/rslint-test-tools/tests/eslint-plugin-import/rules/no-webpack-loader-syntax.test.ts Test suite for the new rule with valid/invalid test cases
packages/rslint-test-tools/tests/eslint-plugin-import/rule-tester.ts Enhanced rule tester with filename resolution and error message handling
packages/rslint-test-tools/rstest.config.mts Configuration update to include the new test file
internal/plugins/import/rules/no_webpack_loader_syntax/no_webpack_loader_syntax_test.go Go test implementation with equivalent test cases
internal/plugins/import/rules/no_webpack_loader_syntax/no_webpack_loader_syntax.go Core rule implementation detecting webpack loader syntax
internal/plugins/import/all.go Registration of the new rule in the plugin

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

…port on string arg for accuracy\n\n- Prevent panic on require() with no args\n- Report diagnostics at the literal argument\n- All tests pass locally
@hardfist
Copy link
Copy Markdown
Contributor

hardfist commented Sep 9, 2025

@Thiry1 thanks for your contribution

@hardfist hardfist merged commit 80d056b into web-infra-dev:main Sep 9, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants