🌐
npm
npmjs.com › package › eslint-plugin-unused-imports
eslint-plugin-unused-imports - npm
It works by splitting up the no-unused-vars rule depending on it being an import statement in the AST and providing an autofix rule to remove the nodes if they are imports. This plugin composes the rule no-unused-vars of either the typescript ...
      » npm install eslint-plugin-unused-imports
    
Published   Feb 09, 2026
Version   4.4.1
Author   Mikkel Holmer Pedersen
🌐
Stack Overflow
stackoverflow.com › questions › 76128996 › why-next-lint-not-complaint-of-unused-imports
next.js - Why next lint not complaint of unused imports? - Stack Overflow
That is why we need eslint:recommended to detect the unused imports. It looks like eslint-plugin-unused-imports is needed only if we want ESLint to remove the unused imports automatically.
🌐
Bughowi
bughowi.com › snippets › next-typescript-eslint-config
Eslint Config for Next.js + TypeScript Project - Mohamad Kholid Bughowi
The rule @typescript-eslint/consistent-type-imports is set to warn, encouraging the use of type-imports with a fix option to convert to inline-type-imports. In addition to TypeScript-specific rules, the configuration integrates rules from the unused-imports plugin.
🌐
GitHub
github.com › sweepline › eslint-plugin-unused-imports
GitHub - sweepline/eslint-plugin-unused-imports: Package to separate no-unused-vars and no-unused-imports for eslint as well as providing an autofixer for the latter.
It works by splitting up the no-unused-vars rule depending on it being an import statement in the AST and providing an autofix rule to remove the nodes if they are imports. This plugin composes the rule no-unused-vars of either the typescript ...
Starred by 615 users
Forked by 27 users
Languages   TypeScript 98.2% | JavaScript 1.8% | TypeScript 98.2% | JavaScript 1.8%
🌐
ESLint
eslint.org › docs › latest › rules › no-unused-vars
no-unused-vars - ESLint - Pluggable JavaScript Linter
In environments outside of CommonJS or ECMAScript modules, you may use var to create a global variable that may be used by other scripts. You can use the /* exported variableName */ comment block to indicate that this variable is being exported and therefore should not be considered unused.
🌐
GitHub
github.com › microsoft › vscode-eslint › issues › 1622
import/no-unused-modules disables VS Code error & warning highlights · Issue #1622 · microsoft/vscode-eslint
July 25, 2022 - Hi! 👋 I'm trying to use import/no-unused-modules as part of Next.js project. Here is what happens: Next.js 12.3.4 eslint-plugin-import 2.26.0 ESLint config snippet 'import/no-unused-modules': [ 'error', { unusedExports: true, ignoreExpor...
Author   a-lukianenko
🌐
Simon Dosda
simondosda.github.io › posts › 2021-05-10-eslint-imports.html
Automatically Remove Unused Imports From Your JS Projects | Simon Dosda
July 6, 2021 - To automatically remove unused imports, we will need to add the eslint-plugin-unused-imports plugin.
🌐
Next.js
nextjs.org › docs › pages › api-reference › config › eslint
Configuration: ESLint | Next.js
2 weeks ago - If you're using @next/eslint-plugin-next in a project where Next.js isn't installed in your root directory (such as a monorepo), you can tell @next/eslint-plugin-next where to find your Next.js application using the settings property in your eslint.config.mjs: ... import { defineConfig } from 'eslint/config' import eslintNextPlugin from '@next/eslint-plugin-next' const eslintConfig = defineConfig([ { files: ['**/*.{js,jsx,ts,tsx}'], plugins: { next: eslintNextPlugin, }, settings: { next: { rootDir: 'packages/my-app/', }, }, }, ]) export default eslintConfig
🌐
GitHub
github.com › eslint › eslint › discussions › 18494
Add optional feature to remove unused imports · eslint/eslint · Discussion #18494
Hi, im the maintainer of eslint-plugin-unused-imports. I have started switching projects over to biome because they have a nice optional fixer for removing unused imports. They dont guarantee that ...
Author   eslint
Find elsewhere
🌐
GitHub
github.com › vercel › next.js › issues › 47646
Latest canary release adds unused import to compiled types · Issue #47646 · vercel/next.js
July 15, 2022 - Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000 Binaries: Node: 16.14.0 npm: 8.3.1 Yarn: 1.22.17 pnpm: 7.29.1 Relevant packages: next: 13.2.5-canary.20 eslint-config-next: 13.2.4 react: 18.2.0 react-dom: 18.2.0 ... There's NextRequest imported there, unused in the file.
Published   Mar 29, 2023
🌐
GitHub
github.com › vercel › next.js › issues › 72142
Not working eslintrc.json in Nextjs 15 · Issue #72142 · vercel/next.js
September 12, 2024 - { "name": "prettier-eslint-husky-setting", "version": "0.1.0", "private": true, "scripts": { "dev": "next dev --turbopack", "build": "next build", "start": "next start", "lint": "next lint" }, "dependencies": { "next": "15.0.2", "react": "19.0.0-rc-02c0e824-20241028", "react-dom": "19.0.0-rc-02c0e824-20241028" }, "devDependencies": { "@ianvs/prettier-plugin-sort-imports": "^4.3.1", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", "@typescript-eslint/parser": "^8.12.2", "eslint": "^9.13.0", "eslint-config-next": "^15.0.2", "eslint-config-prettier": "^9.1.0", "eslint-plugin-tailwindcss": "^3.17.5", "eslint-plugin-unused-imports": "^4.1.4", "postcss": "^8", "prettier": "^3.3.3", "prettier-plugin-tailwindcss": "^0.6.8", "tailwindcss": "^3.4.1", "typescript": "^5" } } create-next-app, Linting ·
Author   YouJun-IWON
🌐
GitHub
github.com › import-js › eslint-plugin-import › blob › main › docs › rules › no-unused-modules.md
eslint-plugin-import/docs/rules/no-unused-modules.md at main · import-js/eslint-plugin-import
ignoreExports: an array with files/paths for which unused exports will not be reported (e.g module entry points in a published package) const class MyClass { /*...*/ } function makeClass() { return new MyClass(...arguments) } ... import { e } from 'file-a' import { f } from 'file-b' import * as fileC from 'file-c' export { default, i0 } from 'file-d' // both will be reported export const j = 99 // will be reported
Author   import-js
🌐
Webdevtutor
webdevtutor.net › blog › remove-unused-imports-and-declarations-in-typescript-project-using-eslint
How to Remove Unused Imports and Declarations in Typescript
My eslintrc.json file looks like this prior to adding the plugin and rule, this for a basic react application: { "extends": ["next", "next/core-web-vitals"], "rules": { "no-console": "error", "react/no-unescaped-entities": "off" } } Now after adding the unused imports plugin, this is what my eslintrc.json looks like:
🌐
Medium
mario-gunawan.medium.com › setting-up-linting-formatting-and-pre-commit-in-nextjs-b3f8001d40cb
Linting, Formatting, and Pre-commit Setup in NextJS | by Mario Gunawan | Medium
September 11, 2022 - To use eslint in nextjs, install these 2 dependencies: yarn add --dev eslint yarn add --dev eslint-config-next · After installing dependencies, create .eslintrc.json in your base directory and add those configuration: { "extends": ["next/core-web-vitals", "eslint:recommended"], // Using the unused imports package to autofix unused imports "plugins": ["unused-imports"], "globals": { "JSX": "readonly" } }
🌐
GitHub
github.com › vercel › next.js › discussions › 32798
Problem with ESLint default configuration using TypeScript Enum's · vercel/next.js · Discussion #32798
Btw the rules which is triggered is no-unused-vars tried to switch to @typescript-eslint/no-unused-vars but it doesn't find it. So I tried to install @typescript-eslint/eslint-plugin here my error: npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: nextjs-...
Author   vercel
🌐
DEV Community
dev.to › garbanv › if-eslint-wont-let-you-build-your-nextjs-15-app-because-of-no-unused-vars-do-this-30kc
If ESLint won't let you build your NextJS 15 app because of no-unused-vars do this - DEV Community
January 29, 2025 - When you try to deploy your new NEXTJs 15 site and see this error: [!ERROR] Warning: 'someParams' is defined but never used. no-unused-vars · You just need to disable a eslint configuration by adding a rule like this one: rules:{ "@typescript-eslint/no-unused-vars": "off" } So the complete eslint.config.mjs will look like this · import { dirname } from "path"; import { fileURLToPath } from "url"; import { FlatCompat } from "@eslint/eslintrc"; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); const compat = new FlatCompat({ baseDirectory: __dirname, }); const eslintConfig = [ ...compat.config({ extends: ['next/core-web-vitals', 'next/typescript'], rules:{ "@typescript-eslint/no-unused-vars": "off" } }), ] export default eslintConfig; Subscribe ·
🌐
CodeSandbox
codesandbox.io › examples › package › eslint-plugin-unused-imports
eslint-plugin-unused-imports examples - CodeSandbox
Use this online eslint-plugin-unused-imports playground to view and fork eslint-plugin-unused-imports example apps and templates on CodeSandbox.
🌐
Restack
restack.io › p › react-answer-remove-unused-imports
React Remove Unused Imports | Restackio
Open your ESLint configuration file. Add the no-unused-vars rule. This rule will flag any variables that are declared but not used anywhere in your code, including imports.