From a9009f678a1380d8e3fcea759a18f3ef50ca3cea Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Tue, 18 May 2021 17:45:55 -0700 Subject: [PATCH] `require-array-join-separator`: Rename from `array-join-separator` (#1295) --- ...separator.md => require-array-join-separator.md} | 0 index.js | 2 +- readme.md | 4 ++-- ...separator.js => require-array-join-separator.js} | 2 +- ...parator.mjs => require-array-join-separator.mjs} | 0 ...r.mjs.md => require-array-join-separator.mjs.md} | 4 ++-- ...s.snap => require-array-join-separator.mjs.snap} | Bin 7 files changed, 6 insertions(+), 6 deletions(-) rename docs/rules/{array-join-separator.md => require-array-join-separator.md} (100%) rename rules/{array-join-separator.js => require-array-join-separator.js} (97%) rename test/{array-join-separator.mjs => require-array-join-separator.mjs} (100%) rename test/snapshots/{array-join-separator.mjs.md => require-array-join-separator.mjs.md} (95%) rename test/snapshots/{array-join-separator.mjs.snap => require-array-join-separator.mjs.snap} (100%) diff --git a/docs/rules/array-join-separator.md b/docs/rules/require-array-join-separator.md similarity index 100% rename from docs/rules/array-join-separator.md rename to docs/rules/require-array-join-separator.md diff --git a/index.js b/index.js index 0aa4bb9652..92dfe438ea 100644 --- a/index.js +++ b/index.js @@ -39,7 +39,6 @@ module.exports = { 'unicorn' ], rules: { - 'unicorn/array-join-separator': 'error', 'unicorn/better-regex': 'error', 'unicorn/catch-error-name': 'error', 'unicorn/consistent-destructuring': 'error', @@ -118,6 +117,7 @@ module.exports = { 'unicorn/prefer-ternary': 'error', 'unicorn/prefer-type-error': 'error', 'unicorn/prevent-abbreviations': 'error', + 'unicorn/require-array-join-separator': 'error', 'unicorn/string-content': 'off', 'unicorn/throw-new-error': 'error' } diff --git a/readme.md b/readme.md index 12d519c192..a151cf8538 100644 --- a/readme.md +++ b/readme.md @@ -35,7 +35,6 @@ Configure it in `package.json`. "unicorn" ], "rules": { - "unicorn/array-join-separator": "error", "unicorn/better-regex": "error", "unicorn/catch-error-name": "error", "unicorn/consistent-destructuring": "error", @@ -113,6 +112,7 @@ Configure it in `package.json`. "unicorn/prefer-ternary": "error", "unicorn/prefer-type-error": "error", "unicorn/prevent-abbreviations": "error", + "unicorn/require-array-join-separator": "error", "unicorn/string-content": "off", "unicorn/throw-new-error": "error" } @@ -133,7 +133,6 @@ Each rule has emojis denoting: | Name                                          | Description | ✅ | 🔧 | | :-- | :-- | :-- | :-- | -| [array-join-separator](docs/rules/array-join-separator.md) | Enforce using the separator argument with `Array#join()`. | ✅ | 🔧 | | [better-regex](docs/rules/better-regex.md) | Improve regexes by making them shorter, consistent, and safer. | ✅ | 🔧 | | [catch-error-name](docs/rules/catch-error-name.md) | Enforce a specific parameter name in catch clauses. | ✅ | 🔧 | | [consistent-destructuring](docs/rules/consistent-destructuring.md) | Use destructured variables over properties. | ✅ | 🔧 | @@ -210,6 +209,7 @@ Each rule has emojis denoting: | [prefer-ternary](docs/rules/prefer-ternary.md) | Prefer ternary expressions over simple `if-else` statements. | ✅ | 🔧 | | [prefer-type-error](docs/rules/prefer-type-error.md) | Enforce throwing `TypeError` in type checking conditions. | ✅ | 🔧 | | [prevent-abbreviations](docs/rules/prevent-abbreviations.md) | Prevent abbreviations. | ✅ | 🔧 | +| [require-array-join-separator](docs/rules/require-array-join-separator.md) | Enforce using the separator argument with `Array#join()`. | ✅ | 🔧 | | [string-content](docs/rules/string-content.md) | Enforce better string content. | | 🔧 | | [throw-new-error](docs/rules/throw-new-error.md) | Require `new` when throwing an error. | ✅ | 🔧 | diff --git a/rules/array-join-separator.js b/rules/require-array-join-separator.js similarity index 97% rename from rules/array-join-separator.js rename to rules/require-array-join-separator.js index 0368b4ec14..6a1a870b10 100644 --- a/rules/array-join-separator.js +++ b/rules/require-array-join-separator.js @@ -3,7 +3,7 @@ const {isCommaToken} = require('eslint-utils'); const getDocumentationUrl = require('./utils/get-documentation-url'); const methodSelector = require('./utils/method-selector'); -const MESSAGE_ID = 'array-join-separator'; +const MESSAGE_ID = 'require-array-join-separator'; const messages = { [MESSAGE_ID]: 'Missing the separator argument.' }; diff --git a/test/array-join-separator.mjs b/test/require-array-join-separator.mjs similarity index 100% rename from test/array-join-separator.mjs rename to test/require-array-join-separator.mjs diff --git a/test/snapshots/array-join-separator.mjs.md b/test/snapshots/require-array-join-separator.mjs.md similarity index 95% rename from test/snapshots/array-join-separator.mjs.md rename to test/snapshots/require-array-join-separator.mjs.md index be97b65ec8..99dfd6919a 100644 --- a/test/snapshots/array-join-separator.mjs.md +++ b/test/snapshots/require-array-join-separator.mjs.md @@ -1,6 +1,6 @@ -# Snapshot report for `test/array-join-separator.mjs` +# Snapshot report for `test/require-array-join-separator.mjs` -The actual snapshot is saved in `array-join-separator.mjs.snap`. +The actual snapshot is saved in `require-array-join-separator.mjs.snap`. Generated by [AVA](https://avajs.dev). diff --git a/test/snapshots/array-join-separator.mjs.snap b/test/snapshots/require-array-join-separator.mjs.snap similarity index 100% rename from test/snapshots/array-join-separator.mjs.snap rename to test/snapshots/require-array-join-separator.mjs.snap