question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

v3.6 ignores "smart-tabs" rule and notifies of indent errors

See original GitHub issue

I’m a maintainer of Leaflet, and we use an eslint config with smart-tabs, like:

      "no-mixed-spaces-and-tabs": [2, "smart-tabs"],
      "indent": ["error", "tab", {"VariableDeclarator": 0}],

eslint 3.0 through 3.5 work just fine. However, after an upgrade to eslint 3.6, we’ve got error messages like the following:

/home/ivan/devel/Leaflet/src/control/Control.js
   64:7  error  Expected indentation of 2 tabs but found 4 spaces and 2 tabs  indent

This can be reproduced by checking out the Leaflet repo, then running npm install and then npm test. Note that running npm install eslint@3.5 then npm test will work as expected.

We don’t use any transpiler in the Leaflet toolchain; full eslint config is available on the Leaflet repo; and the bug is reproducible on the environments of more than one developer.

Looking at eslint’s changelog, I’ll guess that this is caused by #7076 (ping @not-an-aardvark)

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:19 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
nzakascommented, Sep 27, 2016

Ah yes, looked at this too quickly, you’re right. I’ll look at reverting that for now and we can revisit whether or not there should be two rules at a later point.

0reactions
not-an-aardvarkcommented, Sep 27, 2016

If someone can make the correct fix, that’s fine, but if no one has the time to do that today, then we should revert the commit to do a patch release.

I made a PR to fix the issue at https://github.com/eslint/eslint/pull/7266.

This is also a good reminder to make sure each PR solves only one problem so that reverts are clean.

Fair enough, will keep that in mind for future PRs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

indent - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
How to supress error: Mixed spaces and tabs? - Stack Overflow
Disable rule per section. To ignore that error for multiple lines of code, surround the code with eslint-disable no-mixed-spaces-and-tabs ...
Read more >
Unexpected Indent Error in Visual Studio Python Interactive ...
I successfully ran your code in Visual Studio 2017, whether it is four spaces or a Tab, it runs successfully. for j in...
Read more >
Tabs and indents settings does not work
Hello,. I have a problem with tab and indents settings. In settings->codestyle->php->tabs&indents I have set tab character for indent.
Read more >
Developers Who Use Spaces Make More Money Than Those ...
Do you use tabs or spaces for code indentation? ... But for now, the universality and raw power of vi & vim is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found