Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vitest-dev/eslint-plugin-vitest
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.2.2
Choose a base ref
...
head repository: vitest-dev/eslint-plugin-vitest
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.2.3
Choose a head ref
  • 4 commits
  • 14 files changed
  • 2 contributors

Commits on Jun 12, 2025

  1. chore: remove unused imports

    veritem committed Jun 12, 2025
    Configuration menu
    Copy the full SHA
    66728a0 View commit details
    Browse the repository at this point in the history
  2. Add no-importing-from-vitest-globals and `prefer-importing-from-vit…

    …est-globals` rules (#711)
    
    * exclude non-vitest import
    
    * exclude default import because it can be vitest.defineConfig()
    
    * add test case
    
    * exclude an edge case default import
    
    * hard-code a list of disallowed imports
    
    * fix error message
    
    * reformat code
    
    * apply fix for one-import scenario
    
    * refactor - extract `checkSpecifier`
    
    * remove the entire import if all imports are disallowed
    
    * apply fix for disallowed import being on first position
    
    * update test with real examples
    
    * apply fix for disallowed import being on second position
    
    * remove unnecessary `return null`
    
    * add test cases
    
    * exclude non-require functions
    
    * exclude non-vitest require
    
    * exclude default require
    
    * loop through `require` destructuring to find disallowed props
    
    * refactor - invert if condition
    
    * apply fix for simple require case
    
    * apply fix for multiple declaration cases
    
    * apply fix for multiple properties scenario
    
    * refactor - extract `checkProperty`
    
    * refactor - extract `removeDeclarator`
    
    * apply fix for all-properties-are-disallowed scenario
    
    * add test cases
    
    * fix code comment
    
    * remove test comments
    
    * report `node: specifier` instead of `node`
    
    * use `TSESTree` constants
    
    * add semi-colons to test cases
    
    * refactor - extract `isRequireVitestCall` and `isObjectPattern` helper functions
    
    * extract `isDisallowedProperty`
    
    * refactor - `isDisallowedSpecifier`
    
    * extract `VITEST_GLOBALS` to a separate file
    
    * move `isVitestGlobalsImportSpecifier` to separate file
    
    * move `isVitestGlobalsProperty` to separate file
    
    * move more functions to `guards.ts`
    
    * update spacing
    
    * move `removeVariableDeclarator` to a new file
    
    * extract `isVitestImport`
    
    * rename file
    
    * extract `removeNodeFromArray`
    
    * remove unnecessary one-property check
    
    * refactor - move `const specifiers = node.specifiers;` higher
    
    * remove unnecessary code comment
    
    * add rule to index
    
    * create skeleton for `prefer-importing-vitest-globals`
    
    * limit to `VITEST_GLOBALS` list
    
    * report the correct name
    
    * fix formatting
    
    * handle import scenarios
    
    * add test cases
    
    * handle require scenarios
    
    * add basic fixer
    
    * handle default import
    
    * handle namespace import
    
    * fix test case
    
    * fix test cases
    
    * minor refactor
    
    * replace `TSESTree.AST_NODE_TYPES` with `AST_NODE_TYPES`
    
    * extract `findVitestImport`
    
    * add to index
    
    * create readme
    
    * Update no-importing-vitest-globals.md
    
    * Update no-importing-vitest-globals.md
    
    * Update prefer-importing-vitest-globals.md
    
    * Update no-importing-vitest-globals.md
    
    * Update README.md
    
    * update description
    
    * refactor - extract `isVitestGlobalsFunction`
    
    * refactor - shorten function
    
    * refactor - move `name` higher
    
    * rename variable
    
    * remove linebreaks
    
    * update test cases formatting
    
    * update test cases formatting
    
    * remove unused imports
    
    * refactor - remove `findVitestImport`
    
    * remove unnecessary `!`
    
    * handle require properties scenario
    
    * refactor `vitestImport` to `vitestImportSpecifiers`
    
    * add test case
    
    * run `pnpm lint:js`
    
    * PR comment - remove from recommended rules
    
    * PR comment - extend the list of `VITEST_GLOBALS`
    samuelko123 authored Jun 12, 2025
    Configuration menu
    Copy the full SHA
    e590e39 View commit details
    Browse the repository at this point in the history
  3. feat: apply linter

    veritem committed Jun 12, 2025
    Configuration menu
    Copy the full SHA
    ef45a3f View commit details
    Browse the repository at this point in the history
  4. chore: release v1.2.3

    veritem committed Jun 12, 2025
    Configuration menu
    Copy the full SHA
    ae0c9e5 View commit details
    Browse the repository at this point in the history
Loading