From 10cf806583e31604d0057e9c54efa28bcc88ab8a Mon Sep 17 00:00:00 2001 From: Splines Date: Mon, 19 Feb 2024 12:25:58 +0100 Subject: [PATCH 1/5] Clean up minor matters --- .vscode/settings.json | 2 +- README.md | 2 +- index.js | 5 ----- lib/index.js | 5 ----- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 8c0bdd4..470c5c2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,5 +9,5 @@ "source.fixAll.eslint": "explicit" }, // this disables VSCode built-int formatter (instead we want to use ESLint) - "javascript.validate.enable": false, + "javascript.validate.enable": false } \ No newline at end of file diff --git a/README.md b/README.md index d8d1eeb..fcda847 100644 --- a/README.md +++ b/README.md @@ -187,7 +187,7 @@ If you're using VSCode, you may find this `settings.json` options useful: "editor.defaultFormatter": "dbaeumer.vscode-eslint" // use ESLint plugin }, "editor.codeActionsOnSave": { - "source.fixAll.eslint": true // Auto-fix ESLint errors on save + "source.fixAll.eslint": "explicit" // Auto-fix ESLint errors on save }, // this disables VSCode built-int formatter (instead we want to use ESLint) "javascript.validate.enable": false, diff --git a/index.js b/index.js index 28899b6..e2cedf8 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,3 @@ -/** - * @fileoverview Exports the processor. - * @author Splines - */ - "use strict"; module.exports = require("./lib"); diff --git a/lib/index.js b/lib/index.js index db08552..784a90a 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,8 +1,3 @@ -/** - * @fileoverview Process ERB files for consumption by ESLint. - * @author Splines - */ - // Load processor const preprocess = require("./preprocess.js"); const postprocess = require("./postprocess.js"); From 54de02328938ef7c24ee9d08ab8b5619f69743e3 Mon Sep 17 00:00:00 2001 From: Splines Date: Mon, 19 Feb 2024 12:34:03 +0100 Subject: [PATCH 2/5] Improve VSCode `settings.json` with Git warnings --- .vscode/settings.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 470c5c2..4cdc5ee 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,7 @@ { + ////////////////////////////////////// + // JS (ESLint) + ////////////////////////////////////// "eslint.format.enable": true, "eslint.experimental.useFlatConfig": true, "[javascript]": { @@ -9,5 +12,11 @@ "source.fixAll.eslint": "explicit" }, // this disables VSCode built-int formatter (instead we want to use ESLint) - "javascript.validate.enable": false + "javascript.validate.enable": false, + ////////////////////////////////////// + // Git + ////////////////////////////////////// + "git.inputValidation": "warn", + "git.inputValidationSubjectLength": 50, + "git.inputValidationLength": 72 } \ No newline at end of file From ba20280f8ea15b8b4043dea05dec22e57bd8fed3 Mon Sep 17 00:00:00 2001 From: Splines Date: Mon, 19 Feb 2024 12:34:32 +0100 Subject: [PATCH 3/5] Update Readme with `reportUnusedDisableDirective` --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index fcda847..5015919 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,15 @@ export default [ // in your settings.json erb.configs.recommended, { + linterOptions: { + // The "unused disable directive" is set to "warn" by default. + // For the ERB plugin to work correctly, you must disable + // this directive to avoid issues described here + // https://github.com/eslint/eslint/discussions/18114 + // If you're using the CLI, you might also use the following flag: + // --report-unused-disable-directives-severity=off + reportUnusedDisableDirectives: "off", + }, // your other configuration options } ]; @@ -96,6 +105,15 @@ export default [ ...globals.node, }, }, + linterOptions: { + // The "unused disable directive" is set to "warn" by default. + // For the ERB plugin to work correctly, you must disable + // this directive to avoid issues described here + // https://github.com/eslint/eslint/discussions/18114 + // If you're using the CLI, you might also use the following flag: + // --report-unused-disable-directives-severity=off + reportUnusedDisableDirectives: "off", + }, }, ]; ``` @@ -123,6 +141,15 @@ export default [ processor: erb.processors.erbProcessor, }, { + linterOptions: { + // The "unused disable directive" is set to "warn" by default. + // For the ERB plugin to work correctly, you must disable + // this directive to avoid issues described here + // https://github.com/eslint/eslint/discussions/18114 + // If you're using the CLI, you might also use the following flag: + // --report-unused-disable-directives-severity=off + reportUnusedDisableDirectives: "off", + }, // your other configuration options } ]; From cdaa872e2d50b75b7ba14be085ec00527b1ed716 Mon Sep 17 00:00:00 2001 From: Splines Date: Tue, 20 Feb 2024 12:03:28 +0100 Subject: [PATCH 4/5] Fix Readme warning box formatting --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5015919..27f415c 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ A zero-dependency plugin for [ESLint](https://eslint.org/). ![showcase-erb-lint-gif](https://github.com/Splines/eslint-plugin-erb/assets/37160523/623d6007-b4f5-41ce-be76-5bc0208ed636?raw=true) -> [!WARNING] -> v2.0.0 is breaking. We now use the new ESLint flat config format. Use `erb:recommended-legacy` if you want to keep using the old `.eslintrc.js` format. +> **Warning** +> v2.0.0 is breaking. We use the new ESLint flat config format. Use `erb:recommended-legacy` if you want to keep using the old `.eslintrc.js` format. ## Usage From f4f72fdd529f9259e6ce07641af913c7e879a558 Mon Sep 17 00:00:00 2001 From: Splines Date: Tue, 20 Feb 2024 12:05:02 +0100 Subject: [PATCH 5/5] Bump version specifier to 2.0.1 --- lib/index.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 784a90a..a0ea0ea 100644 --- a/lib/index.js +++ b/lib/index.js @@ -11,7 +11,7 @@ const processor = { const plugin = { meta: { name: "eslint-plugin-erb", - version: "2.0.0", + version: "2.0.1", }, configs: { "recommended": { diff --git a/package.json b/package.json index 7407c01..cae1825 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-erb", - "version": "2.0.0", + "version": "2.0.1", "description": "An ESLint plugin to lint JavaScript in ERB files (.js.erb)", "license": "MIT", "author": {