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.

Add configuration: disallow inline rule configuration

See original GitHub issue

What version are you using? v1.1.0

What did you do? We would like use eslint to help us validate the code inside Firefox Add-ons. We should be able to use eslint to do so, but we’d like an option to ignore inline rules (eg /*eslint eqeqeq:0*/) so our code quality checks can’t be defated by add-ons with inline ESLint comment configuration lines in their JS.

What happened? Right now there is no way (that I’ve found) to allow comments but ignore all inline ESLint configs.

What did you expect to happen? We would like to ignore all inline comments so only the configuration passed to ESLint CLI/library on startup are followed.

I will be working on pull request to this, so if the idea would be accepted inside ESLint I’ll submit.

Thanks for the awesome library, folks 👍

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:19 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
tofumattcommented, Sep 23, 2015

Okay, sorry. 😃

Inline things I want to ignore:

  • /*eslint-disable*/ and /*eslint-enable*/
  • /*global*/
  • /*eslint*/
  • /*eslint-env*/

Future-proofing?

I want to ignore literally everything.

We might use plugins to extend ESLint for our validator, and I’d want to protect against the plugin and its options being modified/removed too, so my thought is it’s not a subset of options but an option to simply ignore any inline modification of the config state once you’ve parsed everything from:

  1. Command line options:
    • --global
    • --rule
    • --env
    • -c, --config
  2. Project-level configuration:
    • .eslintrc file in same directory as linted file
    • package.json file in same directory as linted file
    • .eslintrc and package.json files in ancestor directories (parent has highest precedence, then grandparent, etc.), up to and including the root directory or until a config with “root”: true is found.
    • In the absence of any configuration from (1) thru (3), fall back to a personal default configuration in ~/.eslintrc.

I think those four things I want to ignore should cover that, but please let me know if there’s an obvious “attack vector” I’m missing.

0reactions
nzakascommented, Sep 25, 2015

Okay, then I think your use case is too different from this request, so we will need to address separately.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rules - ESLint - Pluggable JavaScript Linter
Disabling Inline Comments ... You can also use the –no-inline-config CLI option to disable rule comments, in addition to other in-line configuration. Report ......
Read more >
Ordered Layers and Inline Layers
The Implied Policy window opens. In the left pane, click Configuration. Select a rule to enable it, or clear a rule to disable...
Read more >
Configure Inline Bypass Examples - Gigamon
1. Configure inline tool ports, port type (inline-tool), and administratively enable inline tool ports.
Read more >
Turning off eslint rule for a specific file - Stack Overflow
1) Disabling "All rules"​​ Two ways you can do this: Put /* eslint-disable-line */ at the end of the line(s),
Read more >
iam-no-inline-policy-check - AWS Config
Checks that inline policy feature is not in use. The rule is NON_COMPLIANT if an AWS Identity and Access Management (IAM) user, IAM...
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