A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/antfu/eslint-config/issues/255 below:

Simplify/enable easy rules overrides · Issue #255 · antfu/eslint-config · GitHub

Clear and concise description of the problem

I recently wanted to migrate our eslint setup to use the new flat config (because it's the best :) ). Found your config in the perfect timing. We're building vite powered vue+ts app so most of your defaults suit us very well, but we have a couple opinionated rules that I'd like to modify. I was surprised that it was not as easy as I thought with the new flat config system for language scope rules.

Here's a minimal repro that is highlighting my problem:
https://stackblitz.com/edit/stackblitz-starters-bcd913?file=eslint.config.js

Trying to override a TS rule to meet my requirements as such:
'ts/consistent-type-definitions': ['error', 'type'],
Running eslint throws this error:

It seems like you can get around by making to specify the files pattern to ensure eslint is able to validate against a config that has the rule. see in the repro:

This is not ideal and was hoping that I wouldn't have to do this. Here, I copy pasted the GLOB from your sources.

Suggested solution

I believe we're all fairly new and not super familiar yet with flat config, so I am not 100% sure it is expected from eslint perspective (let me know if not). Assuming yes, I'm thinking this repo could provide api/recipe to ease the process of overriding specific rules.

Thinking about 2 possible solutions:

  // eslint.config.js
  export default [
  ...typescript({
       rules: { 'ts/consistent-type-definitions': ['error', 'type'],  }
  }),
  ...vue(),
]
Alternative

No response

Additional context

ps: Thanks for your work. I'm a big fan of unocss, just started sponsoring you :)

Validations

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4