lint

How to output deprecation warnings for Kotlin code?

与世无争的帅哥 提交于 2020-05-31 07:34:14
问题 I am using the following configuration snippet in my Java/Kotlin Android project in the app/build.gradle file: gradle.projectsEvaluated { tasks.withType(JavaCompile) { options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" } } It generates a verbose output of Lint warnings in .java files when the project is compiled. I would like to achieve the same for .kt files. I found out that Kotlin has compiler options: gradle.projectsEvaluated { tasks.withType(org.jetbrains.kotlin.gradle

Ignore the indentation in a template literal, with the ESLint `indent` rule

≡放荡痞女 提交于 2020-05-25 15:54:02
问题 The ESLint rule for indent allows for you to specify which nodes are ignored, when determining whether the rule should apply to that node, using the ignoredNodes option. I've got the following code that I want to ignore with this rule: const a = b ? `c${ d }` : e Specifically, the line with d and the subsequent line are reported as having two more spaces than they should. I want to ignore those lines from the rule, but I can't figure out the node that should apply. Node types are specified in

Pylint not running as expected in VScode

大兔子大兔子 提交于 2020-04-09 20:51:42
问题 When I am running via shell a pylint : $ pylint decorator.py No config file found, using default configuration ************* Module decorator C: 7, 0: Unnecessary parens after 'print' keyword (superfluous-parens) C: 15, 0: Unnecessary parens after 'print' keyword (superfluous-parens) C: 1, 0: Missing module docstring (missing-docstring) C: 4, 0: Missing function docstring (missing-docstring) C: 6, 4: Missing function docstring (missing-docstring) C: 14, 0: Missing function docstring (missing

MISRA 2012 violation - Type mismatch (Rules 10.1, 10.4)

岁酱吖の 提交于 2020-03-21 18:59:49
问题 I'm facing MISRA C 2012 violation that I can't understand. Following is the code: #define I2C_CCRH_FS ((uint8_t)0x80) #define I2C_CCRH_DUTY ((uint8_t)0x40) #define I2C_CCRH_CCR ((uint8_t)0x0F) typedef struct I2C_struct { volatile uint8_t CR1; volatile uint8_t CR2; volatile uint8_t CCRL; volatile uint8_t CCRH; } I2C_TypeDef; #define I2C_BaseAddress 0x5210 #define I2C ((I2C_TypeDef *) I2C_BaseAddress) I2C->CCRH &= ~(uint8_t)((I2C_CCRH_FS | I2C_CCRH_DUTY) | I2C_CCRH_CCR); In the previous code,

Call requires API level 11(current min is 9) android.app.Activity#onCreateView

◇◆丶佛笑我妖孽 提交于 2020-02-01 20:20:27
问题 After the SDK update (23), I am getting this lint error, I haven't made any change in my code and it was working fine on devices with api level 9. Also I do not call android.app.Activity#onCreateView in my code at all. If i click the auto fix, it puts @SuppressLint("NewApi") to the declaration of the class @SuppressLint("NewApi") public class MyActivity extends android.support.v4.app.FragmentActivity like this and error goes away, I want to be sure if this is the way to go. 回答1: I encountered

ESLint: How to set .eslintrc to recognize 'require'?

╄→尐↘猪︶ㄣ 提交于 2020-01-30 19:32:32
问题 I am new to ESLint, and I have successfully integrated ESLint with IntelliJ. Out of the box, my integration of ESLint did not recognize node , but basic review of documentation made clear that by creating the configuration file named .eslintrc at the root of my project folder (with the proper IntelliJ setting to access this file) and setting "node":true , ESLint recognizes node (i.e., the following complete .eslintrc works). // Contents of .eslintrc at root of project - support for Node and

ng lint command - How can I execute it on only one typescript file?

隐身守侯 提交于 2020-01-29 06:36:04
问题 I am using " ng lint " command from the latest 'angular cli' . Is it possible to run this command on only one typescript file instead of running on all the typescript files in the entire project ? Thanks Adam 回答1: An easy workaround: ng lint | grep nameofyourfile ? 回答2: I know I am late to the party but someone else could benefit from this. We face the same issue and to solve this I have created a package https://www.npmjs.com/package/ng-lintone-cli It is fairly simple package - you just need

webpack主要内容

断了今生、忘了曾经 提交于 2020-01-26 09:52:12
webpack的核心概念: · entry 一个可执行模块或库的入口文件。 · chunk 多个文件组成的一个代码块,例如把一个可执行模块和它所有依赖的模块组合和一个 chunk 这体现了webpack的打包机制。 · loader 文件转换器,例如把es6转换为es5,scss转换为css。 · plugin 插件,用于扩展webpack的功能,在webpack构建生命周期的节点上加入扩展hook为webpack加入功能。 从启动webpack构建到输出结果经历了一系列过程,它们是: 1. 解析webpack配置参数,合并从shell传入和webpack.config.js文件里配置的参数,生产最后的配置结果。 2. 注册所有配置的插件,好让插件监听webpack构建生命周期的事件节点,以做出对应的反应。 3. 从配置的entry入口文件开始解析文件构建AST语法树,找出每个文件所依赖的文件,递归下去。 4. 在解析文件递归的过程中根据文件类型和loader配置找出合适的loader用来对文件进行转换。 5. 递归完后得到每个文件的最终结果,根据entry配置生成代码块chunk。 6. 输出所有chunk到文件系统。 需要注意的是,在构建生命周期中有一系列插件在合适的时机做了合适的事情

Linting not working when using babel-eslint on Sublime Text 3

走远了吗. 提交于 2020-01-22 09:29:47
问题 I am trying to get babel-eslint to work on Sublime 3. I have installed: eslint and babel-eslint globally on npm SublimeLinter package on Sublime SublimeLinter-contrib-eslint package on Sublime Also, I have added: "syntax_map": { ... "JavaScript (Babel)": "javascript" } to my SublimeLinter.sublime-settings file. When I run the linter with "parser": "espree" on my .eslintrc file it works fine. But when I change the parser to babel-eslint it stops working. I tried to follow the tutorial here:

DemoActivity.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details

烈酒焚心 提交于 2020-01-20 06:43:06
问题 i get the following error in my gradle console. Tried looking for the deprecated API but couldn't find it. Thanks in advance!!! Error: DemoActivity.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. public class BaseActivity extends ActionBarActivity { private static final String TAG = "DemoActivity"; DrawerLayout mDrawerlDrawerLayout; FrameLayout actContent; private LinearLayout linear; private ActionBarDrawerToggle actionBarToggle; private Toolbar