The config param of the linter.verify() method doesn't support "extends" property
See original GitHub issueTell us about your environment
- ESLint Version: 3.5.0
- Node Version: 6.5.0
- npm Version: 3.10.6
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
{"extends": "eslint:recommended"}
What did you do? Please include the actual source code causing the issue.
const linter = require("eslint").linter;
const warnings = linter.verify("console.log();", {"extends": "eslint:recommended"});
What did you expect to happen?
I expected linter.verify()
to return an array with two warnings:
- Unexpected console statement (no-console)
- Newline required at end of file but not found (eol-last)
What actually happened? Please include the actual, raw output from ESLint.
linter.verify()
returned []
(an empty array)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Rules - 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 fix eslintrc The file does not match your project config?
The error is basically saying the file eslintrc.js itself is both: Found by ESLint, but; Doesn't match the list of files it's supposed...
Read more >Linter rules - Dart
Use the Dart linter to identify possible problems in your Dart code. You can use the linter through your IDE or with the...
Read more >Testing services - Angular
The TestBed.configureTestingModule() method takes a metadata object that can have most of the properties of an @NgModule. To test a service, you set...
Read more >Configuration | Stylelint
stylelintrc.js. The configuration object has the following properties: rules . Rules determine what the linter looks for and complains about.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @EvgenyOrekhov, okay, then you want to use CLIEngine’s
executeOnText()
method to run the linter against your source text strings.Here’s a rough idea of how you could do this:
That should hopefully be very close to what you want. If you need to tweak the configuration options due to unexpected output or any other reason, take a good look at the many options that can be passed to the CLIEngine constructor.
Hope this helps-- if not, feel free to ask another question here or stop by on our Gitter chat.
@platinumazure Thank you! Your suggestion solves my problem.