diff --git a/.vscode/settings.json b/.vscode/settings.json index 8c0bdd4..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]": { @@ -10,4 +13,10 @@ }, // this disables VSCode built-int formatter (instead we want to use ESLint) "javascript.validate.enable": false, + ////////////////////////////////////// + // Git + ////////////////////////////////////// + "git.inputValidation": "warn", + "git.inputValidationSubjectLength": 50, + "git.inputValidationLength": 72 } \ No newline at end of file diff --git a/README.md b/README.md index d8d1eeb..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 @@ -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 } ]; @@ -187,7 +214,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..a0ea0ea 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"); @@ -16,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": {