Has anyone ever wanted a smarter version of max-len?
For example, if I enable the option ignoreStrings
, and I have a 200-character line with a single string consisting of a single character, the whole line gets ignored. But that seems unreasonable. There has to be a better way to do it.
prettier
? When dealing with opinions, I prefer my own. prettier-eslint used to be supported, but is sadly not any more.
I agree with all of this. Is there a project which exists to aid with formatting based on eslint rules? Like a shared config that duplicates the prettier functionality with as much coverage as possible?
There are just certain ESLint rules that can definitely auto-fix my code given some criteria, but I don't really know where to begin to write a plugin in order to make that happen. I'm happy with the way prettier-eslint
did it.
Here's an example of where I'd want an auto-fix for combinations of rules:
eslintrc
{
"max-len": "warn",
"object-curly-newline": ["error", {"multiline": true}],
"object-property-newline": ["error", {"allowAllPropertiesOnSameLine": true}]
}
// 77 < 80: ok - no fix needed
const obj = {prop1: 'value', prop2: 'value', prop3: 'value', prop4: 'value'};
// 93 > 80: not ok - fix needed
const obj = {prop1: 'value', prop2: 'value', prop3: 'value', prop4: 'value', prop5: 'value'};
// auto-fixed
const obj = {
prop1: 'value',
prop2: 'value',
prop3: 'value',
prop4: 'value',
prop5: 'value'
};
Oops! Something went wrong! :(
ESLint: 6.1.0.
ESLint couldn't find the config "airbnb/base" to extend from. Please check that the name of the config is correct.
The config "airbnb/base" was referenced from the config file in "/home/user/projects/.eslintrc".
If you still have problems, please stop by https://gitter.im/eslint/eslint to chat with the team.
Howdy folks
Just a tiny question:
let hehe = 42;
I use ES3 settings for a very old JS-Engine. (No browser, no node). Whatever...
ESLINT says: Parsing error: Unexpected token hehe.
The variable name is marked / underlined.
I expected something like: let is not supported in ES3.
It's a ES6 feature. And mark the keyword let
.
Or something like that. Why this behavior?
Oops! Something went wrong! :(
ESLint: 6.4.0.
ESLint couldn't find the plugin "eslint-plugin-myplugin".
(The package "eslint-plugin-myplugin" was not found when loaded as a Node module from the directory "/Users/pradheep-9009".)
It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
npm install eslint-plugin-myplugin@latest --save-dev
The plugin "eslint-plugin-myplugin" was referenced from the config file in ".eslintrc.js".