![](/img/trans.png)
[英]Forbidden non-null assertion lint error for document.getElementById()
我正在使用 TypeScript,我有以下定義: 我確定相關元素在帶有contendId的 HTML 文件中定義。 我運行了 eslint,但出現以下錯誤: 那么......處理這種情況的正確方法是什么? 傾向於簡單地添加抑制警告,因為其他選項只會增加復雜性。 但也許我在這里忽略了一個簡單的解決方案 ...
[英]Forbidden non-null assertion lint error for document.getElementById()
我正在使用 TypeScript,我有以下定義: 我確定相關元素在帶有contendId的 HTML 文件中定義。 我運行了 eslint,但出現以下錯誤: 那么......處理這種情況的正確方法是什么? 傾向於簡單地添加抑制警告,因為其他選項只會增加復雜性。 但也許我在這里忽略了一個簡單的解決方案 ...
[英]Yamllint exclude @ symbol check in application.yaml file
我已經使用 linter 來 lint spring-boot 框架application.yaml文件:--- spring: application: name: @project.name@ @project.name@值允許 spring-boot 應用程序從pom.xml文 ...
[英]linting error Value [{"endOfLine":"auto"},"singleQuote",true] should NOT have more than 2 items
我的配置文件有這個:module.exports = { extends: 'eslint-config-universe', // do some additional things with it rules: { 'prettier/prettier': ['error', ...
[英]Disable clang-tidy for ALL (specific) function invocations
我的具體問題是cppcoreguidelines-avoid-magic-numbers正在標記對 setter 的調用。 例如: 這真的不是一個神奇的數字,因為數字所代表的上下文是由 setter 調用本身明確的(在這種情況下是Person的身高)。 所以我希望能夠忽略所有對 set_heigh ...
[英]Lint rule for no-restricted-properties nested object
我想創建一個 lint 規則來阻止使用 window.location.href 但允許使用任何其他 window.location 屬性。 這個適用於所有位置子方法: 但我只想阻止 href 方法。 ...
[英]Custom lint rule added for a XML Layout tag, doesn't report the issue in layout file
因此,我為 FlowLayout 標簽(第 3 方庫)創建了一個自定義 lint 規則,以將其替換為 ConstraintLayout 的 Flow 功能,代碼如下: 將IssueRegistry添加到FLOW_LAYOUT_ISSUE的問題列表中。 調用./gradlew lint命令,結果在{m ...
[英]Custom lint rule kotlin object
賞金將在 7 天后到期。 此問題的答案有資格獲得+50聲望賞金。 Bob想讓更多人關注這個問題。 我正在嘗試創建自定義 lint 規則以避免使用 kotlin object class。object AColors { val white: Color = Color(0xFFFFFFF ...
[英]Android Studio Dolphin+ not detecting custom lint rules
我有一個包含在項目中的自定義 linter,如下所示: 在我升級到 Android Studio Dolphin 之前,此設置運行良好。 對於 Dolphin,即使使用Code -> Inspect code也不會運行自定義 lint 檢查。 它不會出現在檢查中,即使通過Code -> ...
[英]Return statement should not contain assignment in javascript using filter function
我正在使用以下代碼段 const country = ''; const countryCodes = ['SE', 'NL', 'SE', 'FR']; countryCodes.filter((countryCode, index) => { country += countryCodes ...
[英]Not sure how to use ng lint in angular project
我期待我能夠運行 ng lint 並幫助我找到一些錯誤 ...
[英]Flake8: how to select all lints
根據: https://flake8.pycqa.org/en/6.0.0/user/options.html#cmdoption-flake8-select --select=<錯誤> 指定您希望 Flake8 報告的錯誤代碼列表。 與 --ignore 類似。 您可以指定錯誤代碼的 ...
[英]Flutter lint - Don't override fields
我正在嘗試解決 lint 規則警告,不要覆蓋字段,我似乎無法破解它。 我可以就 go 獲得一些幫助嗎我的代碼: 我嘗試刪除 @override 但它仍然不起作用,我們將不勝感激。 ...
[英]CFN-Lint error in nested Cloudformation stack
我正在使用 CloudFormation Nested Stack 創建 AWS 資源,管道在 Gitlab 中運行。 在父堆棧上使用 CFN-Lint 測試時,出現以下錯誤。 ** W3002 此代碼可能僅適用於package cli 命令,因為屬性 (/TemplateURL) 是一個字符串* ...
[英]Flutter lint rules - Avoid method calls or property accesses on a "dynamic" target
我正在解決 lint 問題,所以我需要幫助解決“動態”目標上的避免方法調用或屬性訪問這一問題。 我的代碼如下: 拋出 lint 的行是:baseUrl = value['baseUrl']; value 是拋出 lint 規則的那個 ...
[英]Flutter - Exclude specific linter rule in analysis_options.yaml for a folder
我有一個更大的項目,在 analysis_options yaml 文件中記錄了不同的 linter 規則。 我想排除某些文件夾的規則子集。 示例:我想為規則“prefer_relative_imports”排除孔“lib/application”文件夾 我如何解釋文件夾位置以忽略規則子集? 當所述 ...
[英]`npm run serve` does not fail on errors
我有一個 Vue 視圖,類似於: 如您所見,有一個用於firstItem的導入,但我忘記為secondItem添加一個導入。 我的問題 - 為什么這樣的代碼通過npm run serve成功? 事實上,該網站無法正常工作(如預期的那樣)。 我怎樣才能讓npm run serve失敗,而不是這種令人困 ...
[英]lint throws missingLeanbackSupport for android application
我將編譯和目標 sdk 升級到 API 33,清單中似乎有很多變化,我不斷收到 lint 錯誤 - missingLeanbackSupport , /bitrise/src/app/src/main/AndroidManifest.xml:2: 錯誤:期望一個活動有 android.inten ...
[英]Line 31:9: Expected indentation of 10 space characters but found 8 react/jsx-indent
當我使用npm start正常運行我的應用程序時,它工作正常。 但是當我嘗試使用npm run build創建一個包含我的應用程序生產版本的構建目錄時。我收到一條警告,我應該有空格,縮進似乎通常設置: 錯誤 eslintrc.jsmodule.exports = { env: { b ...
[英]Compile time check if parameter is annotated using Kotlin
我在我的 Android 項目中有一個要求,我需要驗證參數的注釋。 例如在下面的 function 中,我需要確保塊是否具有所需的注釋,否則會拋出編譯錯誤或 lint 錯誤 是否有一些注釋處理可以幫助我或者 lint 檢查可以幫助我謝謝你。 ...
[英]How do I let VScode use the newest Ruby Parser for RuboCop
問題看起來像這樣: 我使用的是 MacBook Air (M2)。 Ruby版本為ruby 3.1.2p20,解析器版本為3.3.7。 這些是我有的相關擴展,所有設置都是默認的。 web 找遍了也沒找到解決辦法。 我希望 VSCode 使用最新的 Ruby 解析器,這樣當我嘗試在 Ruby ...