-
Notifications
You must be signed in to change notification settings - Fork 4.4k
How to turn off ESLint? #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Commenting out this block in preLoaders: [
{
test: /\.vue$/,
loader: 'eslint',
include: projectRoot,
exclude: /node_modules/
},
{
test: /\.js$/,
loader: 'eslint',
include: projectRoot,
exclude: /node_modules/
}
], |
@SystemZ That's what I would do. 🙂 We're planning on eventually making features such as linting optional when generating a new project, so that should help in the future! |
in vue 2.8.1 there is no
|
Shouldn't eslint linting on build be turned off by default ? I don't want to be unable to launch the app in develop mode because my Atom linting package just updated with a minor bug and my code is indentend with 4 spaces instead of 2... |
I second this. Would love to see more control over eslint. I hate when vue crashes in dev because I forgot a semicolon, however this would be acceptable (if not desired) behavior when building for production. |
I trawled Google and eslint docs & established this eslint options setup. Place it in your .eslint.js file within the vue project root dir. Man, that tab and space restriction is brutal.....
The Road To Customization:1. List of eslint rules and how to turn them off: 2. Single file comments inside your javascript syntax to modify eslint config/behaviour (Didn't try but was within the eslint docs and looks handy):
This was sourced from: Link Here 3. Ignore files via eslintignore:
4. Possible helpful info at eslint I am using es6 imports and have lots of variables and functions that are declared on one file then invoked on another. Was thinking of applying eslint to the bundled app.js file only, but didn't get that far. If anyone can help or has gone a similar route, would be great to hear from you. |
ESLINT is the worst thing to have ever happened since WW2, I think there should be an option to wipe it out entirely. I spent more time counting spaces and tabs than coding. Peter's answer finally did the trick. |
Eslint is fine, what really sucks here is the dumbass who came out with all these stupid rules, like no spaces before function parenthesis and trailing comas EVERYWHERE. FFS! |
One quick way is to add a line of |
If I wanted to use CoffeeScript for some .vue files and JavaScript in others, can I somehow keep ESLint on, but have it ignore templates that use CoffeeScript? |
-- So what do you do for living? |
Please use ESLINT. Edit the rules if you please. It's totally configurable. I also don't like some of them. And as @jaxondu commented, |
@gangsthub ESLINT is totally useless; WAY TOO NITPEAKY. I spend my time adding spaces, making sure my lines are less than 100 characters long.... Removing it all together is the best thing to do. |
If you want it to be less nitpicky, create your own, smaller set of rules. Writing code that doesnT follow a clear style is counterproductive in teams, it increases the cognitive load necessary to navigate other people's code. If you work alone, that's not a big deal, but it's not good general advice |
Totally agree @LinusBorg Just make an effort to modify and then work with lint. I think the vue cli is a nice platform to work off. |
Use ESLINT or use any other technique to format your code and keep it clean. But I disagree.
Sorry, sir, but, it ain't that way. ESLINT does its job. And you should keep your code clean. IMHO. I agree with @LinusBorg. |
You can always use some Style CI services to format the code for you and your team. So you don't waste tons of time linting, when you should be spending every second on coding. Don't go full fanboy mode, please. Evangelism is counterproductive. |
never used Vue before; using a tutorial but eslint crashes on |
No, not to my knowledge (I'm the main maintainer atm). A bit more detail would be helpful. Could you open a fresh issue? |
Ok thanks @LinusBorg, I'll play with it a bit more. Since I'm just learning Vue, I decided "turned off" ESLint temporarily by adding an exception rule
|
@janzheng Thank you! I understand people wanting code to be formatted a certain way, but I'm kinda tired of 'others' alway's determining what that should be. My back end is in python and django and I'd like my JS formatted the same way as my python code as it's way less cognitive load to not see things formatted differently. What I find strange is that I wasn't having any of these lint issues when I first started this project.. now today mysteriously every other line is barking about semicolons, or single quotes instead of double quotes or the number of spaces.. WTF? maddening to say the least. @janzheng method was exactly what I was looking for. if I joined another team that had different styles I'd conform in a heartbeat, but on projects were it's just me I'd rather linting stay out of the way and let me write code how I want. |
When using the latest version of vue-cli it appears the easiest way to handle this is in config/index.js. You'll see the following:
Default is true. Just set to false. BTW, I also dislike ESLint. |
Here's a lame hack to eslint-plugin-vue that "skips over" coffeescript in *.vue files. This is clearly not a suggested approach, but perhaps we could eventually have a user configurable way to elide <script> tags with a lang such as "coffeescript". https://github.com/vuejs/eslint-plugin-vue/pull/446/files |
What is the big deal? Use if you want. Dont use if you don't want! Personally, I find it useful when team size is kind of more than 4 and each one working from different part of Globe. |
Also there's one more way.....you can add the files which give error in your .eslintignore file in the project. |
my fix for the vue webpack webpack.base.conf.js comment out these lines LINE (11 - 20):
|
How to turn all the errors into warnings? I too want to keep my code clean, but some rules are made up by rediculous authistics and make coding in dev mode very impoductive. |
@RoelRoel you can override the severity of the rules in your .eslintrc.js file.
You just need to know the rule names you're overriding. If you're using the |
If vue-cli was used to initiate the project, go to config/index.js and change an attribute in the dev object; |
your_project/config/index.jschange the value of useEslint from true to false, from line 26, inside:
note: I use the vue webpack template, the version of the template is 1.3.1 |
Hi tried all of the above and it is still linting. Any other suggestions? |
This finally seemed to do it I won't be using esLint every. Its rules are in my view actually bad layout, and I don't have several days to spend changing the configuration. |
I think eslint on it own has no issues but the rules are what turn people off as a vuejs dev we should just remove it completely from the boilerplate code Quick fix is inside |
ESLint
|
Great ! That saved me. |
I don't want to disable eslint entirely, I just don't want it in the build output. It's damn near impossible to find a build error as the build output overflows most build logs. Especially Can I disable it for the build output only? |
The easiest way to work around eslint is to use 🟢 Place the comment/s in the script section of your 📌 The above special comments have been referenced from the hint provided by the Vue cli in the terminal. There is no need to touch any config file whatsoever. I hope the above may help. |
@silent-human The issue isn't necessarily that eslint is on, it's that it clogs up the build log. Using ESLint in my editor or IDE is great, but having a tens of thousands of lines long build log full of ESLint warnings is a bloody chore. |
thanks @EdwinBetanc0urt the thing that this config is hidden when creating project by default is Fking horrible |
This worked for me, but the wording is bad. "lintOnSave" made me think when "I save" which doesn't clue me that it will work during build.
Bottom of page: |
Most of these steps didn't work for me, though I was able to disable on a per file by using If you have trouble like I did, you can destructively remove it by removing all references to ES-Lint from your package.json file, and then run I liken using ESLint defaults to working with a germaphobe when your trying to build a floor. Sweeping the floor every 3 minutes is a unproductive when your busy cutting boards, and likewise, zealous linting in development is a barrier to productive workflow for a lot of people. I see the value in linting, and may add it back later, but the config is a pain that seems to silently fail or ignore your rules alot of the time, and it's not worth it for prototypes. |
Yeah that's what I did, and when was wrapping up my prototype I turned the
linter back on and had about 1,500 errors! But by then the prototype was
functional and I knew what I was doing, so I'd spent some time to put
linting strategically back in place.
The way I set it up was through `package.json` where I can choose to run a
commit or build with or without linting, that way I have a little more
fine-grained control.
…On Wed, Feb 26, 2020 at 12:15 AM Bryan Winter ***@***.***> wrote:
Most of these steps didn't work for me, though I was able to disable by
using /* eslint-disable */ on the top of Javascript files.
Ultimately I like ESLint in principle, but it seems like configuring it
right is really time consuming. So if you have trouble like I did, you can
destructively remove it by removing all references to ES-Lint from your
package.json file, and then run npm i to update.
I liken using ESLint defaults to working with a germaphobe when your
trying to build a floor. Sweeping the floor every 3 minutes is a
unproductive when your busy cutting boards, and likewise, zealous linting
in development is a barrier to productive workflow.
I see the value in linting, and may add it back later, but the config is a
pain and not worth it for prototypes.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#73?email_source=notifications&email_token=AA5QO2FIU6F67HIS2MXG3TLREY6MLA5CNFSM4CAL7UY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM7UFII#issuecomment-591348385>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA5QO2EARPNPOKG2POVT2JDREY6MLANCNFSM4CAL7UYQ>
.
|
Well, this was a mess to turn off. The only thing that did was altering .eslintrc.js. What did not do it was using .eslintignore files or setting So... here's what I did: log to file use ack, which is like grep to find what looks eslint errors (grep would do the same, really) then, taking the above again, progressively weed out recurring error types by adding them to a negative grep filter, after checking that I could live with that particular error type for a while.
adjust
I gotta say, not really Vue's fault, but I am not impressed by eslint's insistence to throw hard errors, in a webpack context, on things that are style errors like missing newlines. Altering the files to add |
Hi
Personally I got so fed up with eslint, that I removed all files related to it, since even when you try turning if off you still get warnings. I know that it is very configurable but personally I consider its default layout rules to be bad practice.
Regards
Paul
From: jpeyret <[email protected]>
Sent: 15 July 2020 22:58
To: vuejs-templates/webpack <[email protected]>
Cc: PaulSimon <[email protected]>; Comment <[email protected]>
Subject: Re: [vuejs-templates/webpack] How to turn off ESLint? (#73)
Well, this was a mess to turn off. The only thing that did was altering .eslintrc.js.
What did not do it was using .eslintignore files or setting useEslint: false, in config/index.js.
So... here's what I did:
log to file
npm run build | tee build.log
use ack, which is like grep to find what looks eslint errors (grep would do the same, really)
ack -i ':\d+\s+error\s+' build.log
then, taking the above again, progressively weed out recurring error types by adding them to a negative grep filter, after checking that I could live with that particular error type for a while.
ack -i ':\d+\s+error\s+' build.log | egrep -v 'prefer-const|quote-props|dot-notation|no-prototype-builtins|object-curly-newline|no-throw-literal
adjust .eslintrc.js with the above filter
+ ,'prefer-const':0
+ ,'quote-props':0
+ ,'dot-notation':0
+ ,'no-prototype-builtins':0
+ ,'object-curly-newline':0
+ ,'no-throw-literal':0
I gotta say, not really Vue's fault, but I am not impressed by eslint's insistence to throw hard errors, in a webpack context, on things that are style errors like missing newlines. Altering the files to add /* eslint-disable */ seems like a pain as well - with many files that's a lot of git diff churn to turn it off and on. All in all, a global webpack switch to turn eslint on/off for a build would be much appreciated.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#73 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGHWSVVKKEAVA3GZNUGPIUTR3YRAHANCNFSM4CAL7UYQ>.
|
|
Many thanks to @jaxondu! Your comment with |
setting |
Hello, I just need to sketch simple app, debugging style errors are more time consuming than I can afford.
Is there any switch to turn it off temporarily? It's nice feature but not when you have only few minutes to make something :)
The text was updated successfully, but these errors were encountered: