Questions tagged [linter]

NOTE: It is recommend to use the tag static-analysis instead. "Linter" is slang for static analyzer, a tool that analyzes source code to flag programming errors, bugs, stylistic errors, and suspicious constructs at compile-time. The slang "linter" originates from the specific product PC Lint.

"Linter" is slang for static analyzer, a tool that analyzes source code to flag programming errors, bugs, stylistic errors, and suspicious constructs at compile-time. Whereas a dynamic analyzer is a tool that performs similar analysis in run-time.

The slang "linter" originates from the specific product PC Lint, though there are many other such tools for various programming languages and coding standards.

The first linter was written by Stephen C. Johnson in 1978 while working in the Unix operating system at Bell Labs. After that, many other linters have appeared for different purposes and languages, not only C.


Tag usage

Since "linter is slang and not a formal term, it is recommend to use the tag instead. Always use that tag in combination with tags for the specific language, standard and tool used.

Tag usage example: .

Also include versions of the programming language, coding standard and tool where applicable.

326 questions
0
votes
1 answer

Ace editor is showing the error: Line too long

I use ace-linters for ace editor. It is showing the relevant linter warnings for each line on the left bar. I have this line too long error. but I do not need this to show. Is it possible to remove this error? Is there any way to have more control…
Abdul K Shahid
  • 504
  • 1
  • 4
  • 17
0
votes
1 answer

How to add main function to pylint missing-function-docstring (C0116) as an exception?

How can I avoid pylint to mark missing docstring in the main function, without removing any others from the default, like the __init__ method? When I run poetry run pylint src/* --no-docstring-rgx "main" it overwrites the default value to avoid…
Henrique Branco
  • 1,778
  • 1
  • 13
  • 40
0
votes
1 answer

How to solve Error: tailwindcss/no-contradicting-classname?

The classes have the following properties bg-[url('/images/img.webp')] bg-right I need to align the background picture to the right edge, and I get an error when checking with a linter Error: Classnames bg-[url('/images/img.webp')], bg-right are…
Lex2000
  • 155
  • 1
  • 1
  • 12
0
votes
1 answer

How do I run tslint against a single file?

I'm using Angular 14. I have set up a rule in tslint to warn about unused imports, and I can fix this across my project by running > tslint --config tslint-imports.json --fix --project . However, what if I just want to run the fix on a single…
Dave
  • 15,639
  • 133
  • 442
  • 830
0
votes
0 answers

types and intellisense that can be parsed by typescript and other linters using JSDoc

I am trying to add intellisense comments that can be parsed by Typescript and other linters like prettier. How do I get Prettier, ESLint, or Typescript types to be seen by JSDoc style comments? If I just use the clear(s, e) function directly I am…
Gary
  • 2,293
  • 2
  • 25
  • 47
0
votes
0 answers

vscode-htmlhint extension shows errors even when the file is closed

Before asking here I asked the same question to the team of the extension HTMLHint - VS Code Extension for Visual Studio Code, but I didn't get any response. My question is very simple. I have correctly set up the extension and the configuration…
Vizzale
  • 61
  • 7
0
votes
0 answers

Running pnpm lint-fix on a nextjs repository

I have a pull request in with the nextjs project here: https://github.com/vercel/next.js/pull/45238 To get it accepted, I need to run pnpm lint-fix on the code. I am utterly unfamiliar with pnpm and Python, but I got the latter installed correctly…
Nick Hodges
  • 16,902
  • 11
  • 68
  • 130
0
votes
0 answers

ESLint command in terminal returning error

Does anyone else get the same error message when running the command eslint filename.js on the Terminal (bash in VS Code). I have just installed ESlint and have done npm install etc. Here's the error message I get: error message screenshot: I have…
0
votes
0 answers

How to disable autopep8 rule for entire file?

Say, I want to format following python file with autopep8: ## Double '#' at the start of this line will be removed due to E265/E266 # extra space after '=' will be removed due to E222 a = 1 But I want to ignore E265/E266 rules for entire file…
infi
  • 13
  • 3
0
votes
0 answers

How to manually config nevim lsp and linter to make it smarter?

I'm switching from vscode to neovim (currently using lunarvim). One problem bothered me most is that if my included file don't use relative path, but handle these dependencies in Makefile instead, then the lsp failed to navigate, and make linter…
zjnyly
  • 189
  • 1
  • 11
0
votes
0 answers

Error: ENOENT: no such file or directory, realpath lint long path

I have a file path that has 252 characters and I do not know why the linter not working in that file, I getting the error Error: ENOENT: no such file or directory, realpath, in other shorter paths the linter works fine. In addition, if I move my…
Paweł Baca
  • 814
  • 2
  • 15
  • 28
0
votes
0 answers

Validate JSON input against schema in Vue.js

I'm trying to create a JSON input field for my application made in Vue.js. I'm looking for a component/package/library that allows me to: Lint and format the JSON, displaying any errors (like this) Have an interface that displays the line numbers…
0
votes
1 answer

Line magic function `%%pycodestyle` not found

I am using pycodestyle_magic as a linter in Jupyter. I am following the instructions at https://github.com/mattijn/pycodestyle_magic But I get error with 1-cell checking be it '%%pycodestyle' or '%%flake8'. 1st ERROR # 1st CELL %load_ext…
123456
  • 393
  • 3
  • 12
0
votes
1 answer

Linter for unused parameters in a Java project?

CheckStyle had this option in the early versions: http://api.dpml.net/checkstyle/3.5/com/puppycrawl/tools/checkstyle/checks/usage/UnusedParameterCheck.html Looking for a similar checker. Can anyone recommend me something? Testing for this use…
SagwaCat
  • 9
  • 2
0
votes
1 answer

Using custom checkstyle.xml file to check java codes

For our java code base, we tried to implement checkstyle github action for our needs but I couldn't figure out how to implement custom needs. Here is the repo I want to use it. Checker And my yml file to use it. on: pull_request jobs: …
Efe
  • 88
  • 1
  • 7