feat(rule): implement import/no-webpack-loader-syntax#339
feat(rule): implement import/no-webpack-loader-syntax#339hardfist merged 2 commits intoweb-infra-dev:mainfrom
Conversation
✅ Deploy Preview for rslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The CI seems to have failed, so I'll set it to draft and check it later. |
38990f8 to
058fda7
Compare
|
@codex review |
There was a problem hiding this comment.
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".
internal/plugins/import/rules/no_webpack_loader_syntax/no_webpack_loader_syntax.go
Show resolved
Hide resolved
There was a problem hiding this comment.
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.
internal/plugins/import/rules/no_webpack_loader_syntax/no_webpack_loader_syntax.go
Show resolved
Hide resolved
…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
|
@Thiry1 thanks for your contribution |
Summary
implement import/no-webpack-loader-syntax
Related Links
#181
Checklist