Comments (6)
Uh oh! @juliusmarminge, the image you shared is missing helpful alt text. Check your issue body.
Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.
Learn more about alt text at Basic writing and formatting syntax: images on GitHub Docs.
🤖 Beep boop! This comment was added automatically by github/accessibility-alt-text-bot.
from typescript-eslint.
What's the usecase that you have that is failing?
We are intentionally not compatible with the @types/eslint
types in many places because the types have different philosophies.
You could point to any number of places that the types diverge and say "fix it" but without a motivating usecase we aren't going to change it.
Please help us understand your usecase with some code sample(s) that are currently broken.
from typescript-eslint.
I tried writing my config like this (basically just adding the files
options to your configs:
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
/** @type {import("eslint").Linter.FlatConfig[]} */
export default [
{
ignores: [
// some globally ignored files
"pnpm-lock.yaml",
],
},
{
files: ["**/*.js", "**/*.ts", "**/*.tsx"],
rules: eslint.configs.recommended.rules,
},
...[
...tseslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
].map((conf) => ({
files: ["**/*.js", "**/*.ts", "**/*.tsx"],
rules: conf.rules ?? {}, // <-- this type-mismatches
})),
{
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
];
from typescript-eslint.
Sure, I could do:
/** @type {import('typescript-eslint').Config} */
export default [
...
]
instead, but to me atleast i feel like i wanna type this using ESLint since tseslint is just a part of the config?
from typescript-eslint.
As per our docs we suggest not using the ESLint types for your config.
We have found many cases where the @types/eslint
types are overly restrictive and can cause type errors where things should work fine. They have no tests to ensure compatibility with the ecosystem.
OTOH our types are intended to be more forgiving and we have integration tests in place to ensure we can accept all manner of plugins and parsers with many different tsconfigs.
from typescript-eslint.
As an example you could simplify your config with our tooling
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
export default tseslint.config(
{
ignores: [
// some globally ignored files
"pnpm-lock.yaml",
],
},
{
files: ["**/*.js", "**/*.ts", "**/*.tsx"],
extends: [eslint.configs.recommended],
},
{
files: ["**/*.js", "**/*.ts", "**/*.tsx"],
extends: [
...tseslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
],
},
{
languageOptions: {
parserOptions: {
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
);
from typescript-eslint.
Related Issues (20)
- Bug: ESLint raises type-safety warnings for imported functions and types from shared libraries HOT 4
- Docs: remove import from config file in getting started HOT 1
- Bug: [await-thenable] should check `for-await` loop HOT 3
- Docs: Some additional details around contributors/committers
- Enhancement: support `name` field in flat config types
- Repo: Integration tests failing on main with ESLint v9 HOT 1
- Bug: [consistent-type-assertions] false positive "allow-as-parameter" and TaggedTemplate
- Docs: The configuration value for "allowFunctionsWithoutTypeParameters" parameter is incorrect in the explicit-function-return-type rule. HOT 1
- Repo: files outside of `packages` are not being linted or typechecked
- Configs: Remove one of the nullable assertion rules from `strict-type-checked` HOT 1
- deprecate no-magic-numbers
- Bug: Program body element type exception HOT 1
- Bug: Error when using pnpm with package.yaml, 'type: module' not recognized HOT 4
- Bug: [member-ordering] With "method" as a final type, the sort ordering fails.
- Bug: Confusing error when unknown parser used with getParserServices(context, true) in flat config HOT 1
- Bug: Website ESQuery doesn't work for typescript nodes HOT 1
- Enhancement: `RuleTesterConfig#parser` should be optional
- Bug: parserOptions.projectService does not respect extraFileExtensions HOT 3
- Rule proposal: prefer `satisfies` over `as` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typescript-eslint.