Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

217
Views
How to use eslint with Next.js in a project with an existing eslint config?

I have a Node.js project with an existing eslint config, I generated a new next.js project in the same project so now I have

๐Ÿ“ src
๐Ÿ“„ .eslintrc.yml
๐Ÿ“ website
  ๐Ÿ“„ .eslintrc.json

How could I set up next.js's eslint config with my already existing one? This is what the existing one looks like:

env:
  es2020: true
  node: true

extends:
  - eslint:recommended
  - plugin:@typescript-eslint/recommended

parser: "@typescript-eslint/parser"

parserOptions:
  sourceType: module

plugins:
  - "@typescript-eslint"
  - import

rules:
  no-duplicate-imports: error
  no-template-curly-in-string: warn
  no-unreachable-loop: warn
  camelcase: error
  curly: error
  eqeqeq: error
  no-console: error
  no-else-return: error
  no-empty-function: error
  no-eval: error
  no-new: error
  no-param-reassign: error
  no-return-await: warn
  no-unneeded-ternary: error
  no-useless-rename: error
  no-var: error
  prefer-arrow-callback: error
  prefer-const: error
  prefer-destructuring: error
  prefer-object-spread: error
  prefer-template: error
  block-spacing: error
  padding-line-between-statements:
    [error, { blankLine: "always", prev: "*", next: "return" }]
  "@typescript-eslint/explicit-module-boundary-types": off
  "@typescript-eslint/no-shadow": error
  import/order:
    [
      error,
      {
        alphabetize: { caseInsensitive: true, order: asc },
        groups: [[external, builtin], internal, parent, sibling, index],
        newlines-between: never,
      },
    ]
about 4 years ago ยท Juan Pablo Isaza
1 answers
Answer question

0

I decided to remove everything eslint related in the website project and installed eslint-config-next in the root project:

env:
  es2021: true
  shared-node-browser: true

extends:
  - eslint:recommended
  - plugin:@typescript-eslint/recommended
  - next/core-web-vitals
  - prettier

parser: "@typescript-eslint/parser"

parserOptions:
  sourceType: module

plugins:
  - "@typescript-eslint"
  - import

settings:
  next:
    rootDir: "./website"

rules:
  no-duplicate-imports: error
  no-template-curly-in-string: warn
  no-unreachable-loop: warn
  camelcase: error
  curly: error
  eqeqeq: error
  no-console: error
  no-else-return: error
  no-empty-function: error
  no-eval: error
  no-new: error
  no-param-reassign: error
  no-return-await: warn
  no-unneeded-ternary: error
  no-useless-rename: error
  no-var: error
  prefer-arrow-callback: error
  prefer-const: error
  prefer-destructuring: error
  prefer-object-spread: error
  prefer-template: error
  block-spacing: error
  padding-line-between-statements:
    [error, { blankLine: "always", prev: "*", next: "return" }]
  "@typescript-eslint/explicit-module-boundary-types": off
  "@typescript-eslint/no-shadow": error
  import/order:
    [
      error,
      {
        alphabetize: { caseInsensitive: true, order: asc },
        groups: [[external, builtin], internal, parent, sibling, index],
        newlines-between: never,
      },
    ]

I'm not using next lint this way but linting should work fine this way, if I can get some nicer integration I'd be open to suggestions

about 4 years ago ยท Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
ยฉ 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!