lint

One var per function in JavaScript?

我的梦境 提交于 2019-12-17 15:15:40
问题 I've been using JSLint to make me feel bad about my JavaScript. It is great, by the way. There is one check that I don't quite understand and I'd like your views, please. From jslint.com: In languages with block scope, it is usually recommended that variables be declared at the site of first use. But because JavaScript does not have block scope, it is wiser to declare all of a function's variables at the top of the function. It is recommended that a single var statement be used per function.

VIM + JSLint?

无人久伴 提交于 2019-12-17 06:19:13
问题 I spend my days in vim, currently writing a lot of JavaScript. I've been trying to find a way to integrate JSLint or something similar into vim to improve my coding. Has anyone managed to do something like this? Edit: tried this: Javascript Syntax Checking From Vim, unfortunately the output is very crude. 回答1: You can follow the intructions from JSLint web-service + VIM integration or do what I did: Download http://jslint.webvm.net/mylintrun.js and http://www.jslint.com/fulljslint.js and put

What is “Linting”?

那年仲夏 提交于 2019-12-17 02:24:57
问题 PHPLint, JSLint, and I recently came across "you can lint your JS code on the fly" while reading something about some IDE. So, what is this linting that everyone knows but me? 回答1: Linting is the process of running a program that will analyse code for potential errors. See lint on wikipedia: lint was the name originally given to a particular program that flagged some suspicious and non-portable constructs (likely to be bugs) in C language source code. The term is now applied generically to

Sonar: Create new rule for Android Lint

点点圈 提交于 2019-12-13 19:31:22
问题 I am using SonarQube 5.1 in order to collect all Java and Lint errors for Android apps. Almost every important issue is already caught by Sonar using Lint plugin, but I have found at least one issue not included: <issue id="GradleOverrides" severity="Warning" message="This `minSdkVersion` value (`14`) is not used; it is always overridden by the value specified in the Gradle build script (`15`)" category="Correctness" priority="4" summary="Value overridden by Gradle build script" explanation=

Lint Fail for Cocoapods

大憨熊 提交于 2019-12-13 15:10:03
问题 I have an Objective-C Library and I am trying to update the podspec to cocoapods. When I do the "pod spec lint" command I get the following error: [!] The spec did not pass validation, due to 1 error. [!] The validator for Swift projects uses Swift 3.0 by default, if you are using a different version of swift you can use a `.swift-version` file to set the version for your Pod. For example to use Swift 2.3, run: `echo "2.3" > .swift-version`. Here is my podspec file: Pod::Spec.new do |s| s

Display Flycheck buffer (with errors) when saving

雨燕双飞 提交于 2019-12-12 18:12:05
问题 In Emacs, what would be the way to display the Flycheck buffer automatically when saving, only if there are errors? A bit like https://github.com/steelbrain/linter. I've searched on https://stackoverflow.com/questions/tagged/flycheck?sort=votes&pageSize=50 but did not find anything approaching. 回答1: Add the following to ~/.emacs , this will bind it to C-x C-s : (defun save-buffer-maybe-show-errors () "Save buffer and show errors if any." (interactive) (save-buffer) (when (not flycheck-current

PropType is defined but prop is never used

拟墨画扇 提交于 2019-12-12 17:01:07
问题 const propTypes = { prop1: PropTypes.string, prop2: PropTypes.string, prop3: PropTypes.number, }; const something = (props) => ((props.props2 > 0 & props.prop1 === props.props3) ? t('translation/abc') : t('translation/def')); why does the component throw lint error PropType is defined but prop is never used for all three props prop1, prop2, prop3 ? 回答1: This should fix your problem, let's de-structure your props and then assign propTypes to your stateless component. const something = ({prop1,

Is there a Python (3) lint for variable names such as 'len' (built-in functions/reserved words etc)

不想你离开。 提交于 2019-12-12 09:24:40
问题 I got stung by this one (using len in an argument on a method call), then defining a list, and doing len on it, yielding: def fun(len): a = [] ... len(a) >>>TypeError: 'int' object is not callable Is there Python3 lint for the VS Code IDE, that you can configure to report on variables not being reserved words/built-in functions? Or masking/overwriting in general. I didn't expect that behaviour. On reflection I am aware it's a feature of Python that you can pass functions as arguments, hence

Publishing Lint results to Sonar using Gradle

♀尐吖头ヾ 提交于 2019-12-12 07:36:46
问题 I am trying to publish Lint results to a sonar server using Gradle. The other analysis results are published, but the Lint results are not. Does anyone have any experience getting this to work? I could not find any addition information. The version of Sonar is 3.5.1 The version of Gradle is 1.10 The top level build file looks like this (there are 3 subprojects) // Top-level build file where you can add configuration options common to all sub-projects/modules. apply plugin: 'sonar-runner'

Possible OCaml code generation bug

£可爱£侵袭症+ 提交于 2019-12-12 03:49:33
问题 The following self contained code highlights a problem in OCaml, possibly with the code generation. Array x has connectivity information for nodes in [0..9]. Function init_graph originally constructed explicit arrays of incoming nodes for every node. The reduced version shown below just prints the two connected nodes. Function init_graph2 is identical to init_graph except for a "useless" else branch. But outputs produced by these two functions are quite different. You can run it and see that