nfour / eslint-config-standard-typescript-prettier Goto Github PK
View Code? Open in Web Editor NEWA simple eslint config for modern TypeScript projects.
License: MIT License
A simple eslint config for modern TypeScript projects.
License: MIT License
The package prettierx
was created to allow usage of prettier along with standardjs formatting. Maybe it would improve your setup to use it.
The type checks is not working for @typescript-eslint rules. I cloned and repo and tried on the eslint.js file. It works once I change the import from
export type TsEslintPluginRules = Record<
keyof typeof import('@typescript-eslint/eslint-plugin/dist/configs/all.json')['rules'],
any
>;
to
export type TsEslintPluginRules = Record<
keyof typeof import('@typescript-eslint/eslint-plugin/dist/configs/all.js')['rules'],
any
>;
Wondering what do I actually run or add to my package scripts to dot he check? Given I see it uses prettier, standard, and eslint it's just not clear to me.
By the way, thanks for this! I have been struggling with configuring all of these things.
Hi again. :)
First off, I hope you continue maintaining this project. This is by far the easiest way to get estlint+standard+tyepscript working given the known issues in making these things work together when doing so manually. Thanks!
I have encountered a couple of issues though that I wonder if you can comment on (admitting that they're quite likely my fault):
const config = require('eslint-config-standard-typescript-prettier')
module.exports = {
STUFF FROM QUASAR
overrides: [
{
...config,
files: ['**/*.ts', '**/*.tsx']
}
]
}
Should I have been able to just do the appropriate mixing of config? For example
const config = require('eslint-config-standard-typescript-prettier')
module.exports = {
...config,
rules: {
...config.rules,
RULES FROM QUASAR
}]
}
Because I'm not sure if the second problem is causing the first or if I'm just missing something important, I've included both in this one issue. If you tell me they are both real issues, I'll go back and add them to the tracker as separate issues.
Thanks again!
Would you consider licensing your code? Without it, I suspect a lot of people will be in a position where they don't feel comfortable using it.
Happy to help or submit a pull request, but, along with providing a guide to make a decision, Github makes it easy to add a license to your repo.
Thanks for considering it!
When using this module in a React with Typescript problem you get an error with no-use-before-define
in every file you use the React
import.
'React' was used before it was defined. (eslint/no-use-before-define)
This can be fixed by re-enabling the @typescript-eslint/no-use-before-define
that you disabled. Why did you disable this useful rule?
So in .eslintrc.json
add:
"rules": {
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"]
}
npm WARN [email protected] requires a peer of eslint-plugin-standard@^5.0.0 but none is installed. You must install peer dependencies yourself.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.