From 4ccb5cc67ce7eb148e33a5f5959ead4959d8903a Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Thu, 18 Aug 2022 19:24:54 -0400 Subject: [PATCH] docs: tweak rule notices --- docs/rules/destructuring-assignment.md | 2 +- docs/rules/function-component-definition.md | 2 +- docs/rules/hook-use-state.md | 2 +- docs/rules/jsx-boolean-value.md | 2 +- docs/rules/jsx-closing-bracket-location.md | 2 +- docs/rules/jsx-closing-tag-location.md | 2 +- docs/rules/jsx-curly-brace-presence.md | 2 +- docs/rules/jsx-curly-newline.md | 2 +- docs/rules/jsx-curly-spacing.md | 2 +- docs/rules/jsx-equals-spacing.md | 2 +- docs/rules/jsx-first-prop-new-line.md | 4 ++-- docs/rules/jsx-fragments.md | 2 +- docs/rules/jsx-indent-props.md | 2 +- docs/rules/jsx-indent.md | 2 +- docs/rules/jsx-max-props-per-line.md | 2 +- docs/rules/jsx-newline.md | 2 +- docs/rules/jsx-no-leaked-render.md | 2 +- docs/rules/jsx-no-target-blank.md | 2 +- docs/rules/jsx-no-useless-fragment.md | 2 +- docs/rules/jsx-one-expression-per-line.md | 2 +- docs/rules/jsx-props-no-multi-spaces.md | 2 +- docs/rules/jsx-sort-props.md | 2 +- docs/rules/jsx-space-before-closing.md | 2 +- docs/rules/jsx-tag-spacing.md | 2 +- docs/rules/jsx-wrap-multilines.md | 2 +- docs/rules/no-arrow-function-lifecycle.md | 2 +- docs/rules/no-invalid-html-attribute.md | 2 +- docs/rules/no-unknown-property.md | 2 +- docs/rules/prefer-read-only-props.md | 2 +- docs/rules/self-closing-comp.md | 2 +- tests/index.js | 18 ++++++++---------- 31 files changed, 39 insertions(+), 41 deletions(-) diff --git a/docs/rules/destructuring-assignment.md b/docs/rules/destructuring-assignment.md index 5a9845a828..efbe0d9af6 100644 --- a/docs/rules/destructuring-assignment.md +++ b/docs/rules/destructuring-assignment.md @@ -1,6 +1,6 @@ # Enforce consistent usage of destructuring assignment of props, state, and context (react/destructuring-assignment) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. Rule can be set to either of `always` or `never`; ```js diff --git a/docs/rules/function-component-definition.md b/docs/rules/function-component-definition.md index 68319afc9e..12ec29e9b9 100644 --- a/docs/rules/function-component-definition.md +++ b/docs/rules/function-component-definition.md @@ -1,6 +1,6 @@ # Enforce a specific function type for function components (react/function-component-definition) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. This option enforces a specific function type for function components. diff --git a/docs/rules/hook-use-state.md b/docs/rules/hook-use-state.md index 921ef4f84e..7f66bbddb4 100644 --- a/docs/rules/hook-use-state.md +++ b/docs/rules/hook-use-state.md @@ -1,6 +1,6 @@ # Ensure destructuring and symmetric naming of useState hook value and setter variables (react/hook-use-state) -💡 This rule provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). +💡 This rule provides editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions). ## Rule Details diff --git a/docs/rules/jsx-boolean-value.md b/docs/rules/jsx-boolean-value.md index 163281a583..649abcc29e 100644 --- a/docs/rules/jsx-boolean-value.md +++ b/docs/rules/jsx-boolean-value.md @@ -1,6 +1,6 @@ # Enforce boolean attributes notation in JSX (react/jsx-boolean-value) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. [When using a boolean attribute in JSX](https://facebook.github.io/react/docs/jsx-in-depth.html#boolean-attributes), you can set the attribute value to `true` or omit the value. This rule will enforce one or the other to keep consistency in your code. diff --git a/docs/rules/jsx-closing-bracket-location.md b/docs/rules/jsx-closing-bracket-location.md index e2e1fe5e46..cf6295eb2e 100644 --- a/docs/rules/jsx-closing-bracket-location.md +++ b/docs/rules/jsx-closing-bracket-location.md @@ -1,6 +1,6 @@ # Validate closing bracket location in JSX (react/jsx-closing-bracket-location) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. Enforce the closing bracket location for JSX multiline elements. diff --git a/docs/rules/jsx-closing-tag-location.md b/docs/rules/jsx-closing-tag-location.md index d2cbdc1feb..ed5eef9621 100644 --- a/docs/rules/jsx-closing-tag-location.md +++ b/docs/rules/jsx-closing-tag-location.md @@ -1,6 +1,6 @@ # Validate closing tag location in JSX (react/jsx-closing-tag-location) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. Enforce the closing tag location for multiline JSX elements. diff --git a/docs/rules/jsx-curly-brace-presence.md b/docs/rules/jsx-curly-brace-presence.md index f34ce7d661..3f6b2396ea 100644 --- a/docs/rules/jsx-curly-brace-presence.md +++ b/docs/rules/jsx-curly-brace-presence.md @@ -1,6 +1,6 @@ # Enforce curly braces or disallow unnecessary curly braces in JSX props and/or children. (react/jsx-curly-brace-presence) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. This rule allows you to enforce curly braces or disallow unnecessary curly braces in JSX props and/or children. diff --git a/docs/rules/jsx-curly-newline.md b/docs/rules/jsx-curly-newline.md index 348e9a931f..d4491f673f 100644 --- a/docs/rules/jsx-curly-newline.md +++ b/docs/rules/jsx-curly-newline.md @@ -1,6 +1,6 @@ # Enforce linebreaks in curly braces in JSX attributes and expressions. (react/jsx-curly-newline) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. Many style guides require or disallow newlines inside of jsx curly expressions. diff --git a/docs/rules/jsx-curly-spacing.md b/docs/rules/jsx-curly-spacing.md index 9b03b0bb68..a7b1b61d5c 100644 --- a/docs/rules/jsx-curly-spacing.md +++ b/docs/rules/jsx-curly-spacing.md @@ -1,6 +1,6 @@ # Enforce or disallow spaces inside of curly braces in JSX attributes and expressions. (react/jsx-curly-spacing) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. While formatting preferences are very personal, a number of style guides require or disallow spaces between curly braces. diff --git a/docs/rules/jsx-equals-spacing.md b/docs/rules/jsx-equals-spacing.md index c2b0f86cb2..2c9403f0fe 100644 --- a/docs/rules/jsx-equals-spacing.md +++ b/docs/rules/jsx-equals-spacing.md @@ -1,6 +1,6 @@ # Enforce or disallow spaces around equal signs in JSX attributes. (react/jsx-equals-spacing) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. Some style guides require or disallow spaces around equal signs. diff --git a/docs/rules/jsx-first-prop-new-line.md b/docs/rules/jsx-first-prop-new-line.md index 9126c2fe28..c93349beff 100644 --- a/docs/rules/jsx-first-prop-new-line.md +++ b/docs/rules/jsx-first-prop-new-line.md @@ -1,10 +1,10 @@ # Configure the position of the first property (react/jsx-first-prop-new-line) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. Ensure correct position of the first property. -Note: The autofixer does not include indentation. Please rerun lint to correct those errors. +Note: The fixer does not include indentation. Please rerun lint to correct those errors. ## Rule Details diff --git a/docs/rules/jsx-fragments.md b/docs/rules/jsx-fragments.md index aad9b9fd52..b01ca5e81b 100644 --- a/docs/rules/jsx-fragments.md +++ b/docs/rules/jsx-fragments.md @@ -1,6 +1,6 @@ # Enforce shorthand or standard form for React fragments (react/jsx-fragments) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. In JSX, a React fragment is created either with `...`, or, using the shorthand syntax, `<>...`. This rule allows you to enforce one way or the other. diff --git a/docs/rules/jsx-indent-props.md b/docs/rules/jsx-indent-props.md index 21fd3dbf23..2d743da042 100644 --- a/docs/rules/jsx-indent-props.md +++ b/docs/rules/jsx-indent-props.md @@ -1,6 +1,6 @@ # Validate props indentation in JSX (react/jsx-indent-props) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. This option validates a specific indentation style for props. diff --git a/docs/rules/jsx-indent.md b/docs/rules/jsx-indent.md index 06c917295a..4fbf629ac5 100644 --- a/docs/rules/jsx-indent.md +++ b/docs/rules/jsx-indent.md @@ -1,6 +1,6 @@ # Validate JSX indentation (react/jsx-indent) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. This option validates a specific indentation style for JSX. diff --git a/docs/rules/jsx-max-props-per-line.md b/docs/rules/jsx-max-props-per-line.md index bd51ee150c..f97470ca68 100644 --- a/docs/rules/jsx-max-props-per-line.md +++ b/docs/rules/jsx-max-props-per-line.md @@ -1,6 +1,6 @@ # Limit maximum of props on a single line in JSX (react/jsx-max-props-per-line) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. Limiting the maximum of props on a single line can improve readability. diff --git a/docs/rules/jsx-newline.md b/docs/rules/jsx-newline.md index 1ea4a170c8..54ababfd32 100644 --- a/docs/rules/jsx-newline.md +++ b/docs/rules/jsx-newline.md @@ -1,6 +1,6 @@ # Require or prevent a new line after jsx elements and expressions. (react/jsx-newline) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. ## Rule Details diff --git a/docs/rules/jsx-no-leaked-render.md b/docs/rules/jsx-no-leaked-render.md index 7bf7e5ba8a..18945cc6dc 100644 --- a/docs/rules/jsx-no-leaked-render.md +++ b/docs/rules/jsx-no-leaked-render.md @@ -1,6 +1,6 @@ # Prevent problematic leaked values from being rendered (react/jsx-no-leaked-render) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. Using the `&&` operator to render some element conditionally in JSX can cause unexpected values being rendered, or even crashing the rendering. diff --git a/docs/rules/jsx-no-target-blank.md b/docs/rules/jsx-no-target-blank.md index cc39ebbc78..3c18f6f024 100644 --- a/docs/rules/jsx-no-target-blank.md +++ b/docs/rules/jsx-no-target-blank.md @@ -1,6 +1,6 @@ # Prevent usage of unsafe `target='_blank'` (react/jsx-no-target-blank) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. When creating a JSX element that has an `a` tag, it is often desired to have the link open in a new tab using the `target='_blank'` attribute. Using this attribute unaccompanied by `rel='noreferrer'`, however, is a severe security vulnerability (see [noreferrer docs](https://html.spec.whatwg.org/multipage/links.html#link-type-noreferrer) and [noopener docs](https://html.spec.whatwg.org/multipage/links.html#link-type-noopener) for more details) This rules requires that you accompany `target='_blank'` attributes with `rel='noreferrer'`. diff --git a/docs/rules/jsx-no-useless-fragment.md b/docs/rules/jsx-no-useless-fragment.md index 875f7af4fc..76ef1a31ce 100644 --- a/docs/rules/jsx-no-useless-fragment.md +++ b/docs/rules/jsx-no-useless-fragment.md @@ -1,6 +1,6 @@ # Disallow unnecessary fragments (react/jsx-no-useless-fragment) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a [keyed fragment](https://reactjs.org/docs/fragments.html#keyed-fragments). diff --git a/docs/rules/jsx-one-expression-per-line.md b/docs/rules/jsx-one-expression-per-line.md index 7d9b71003f..a1e534b23f 100644 --- a/docs/rules/jsx-one-expression-per-line.md +++ b/docs/rules/jsx-one-expression-per-line.md @@ -1,6 +1,6 @@ # One JSX Element Per Line (react/jsx-one-expression-per-line) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. This option limits every line in JSX to one expression each. diff --git a/docs/rules/jsx-props-no-multi-spaces.md b/docs/rules/jsx-props-no-multi-spaces.md index 5ae4d4938a..e957641903 100644 --- a/docs/rules/jsx-props-no-multi-spaces.md +++ b/docs/rules/jsx-props-no-multi-spaces.md @@ -1,6 +1,6 @@ # Disallow multiple spaces between inline JSX props (react/jsx-props-no-multi-spaces) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. Enforces that there is exactly one space between all attributes and after tag name and the first attribute in the same line. diff --git a/docs/rules/jsx-sort-props.md b/docs/rules/jsx-sort-props.md index acc333a5bf..8312420916 100644 --- a/docs/rules/jsx-sort-props.md +++ b/docs/rules/jsx-sort-props.md @@ -1,6 +1,6 @@ # Enforce props alphabetical sorting (react/jsx-sort-props) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. Some developers prefer to sort props names alphabetically to be able to find necessary props easier at the later time. Others feel that it adds complexity and becomes burden to maintain. diff --git a/docs/rules/jsx-space-before-closing.md b/docs/rules/jsx-space-before-closing.md index 32dd066b0c..c7148fed52 100644 --- a/docs/rules/jsx-space-before-closing.md +++ b/docs/rules/jsx-space-before-closing.md @@ -1,6 +1,6 @@ # Validate spacing before closing bracket in JSX (react/jsx-space-before-closing) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. **Deprecation notice**: This rule is deprecated. Please use the `"beforeSelfClosing"` option of the [jsx-tag-spacing](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md) rule instead. diff --git a/docs/rules/jsx-tag-spacing.md b/docs/rules/jsx-tag-spacing.md index b898c3b28d..c18a47e247 100644 --- a/docs/rules/jsx-tag-spacing.md +++ b/docs/rules/jsx-tag-spacing.md @@ -1,6 +1,6 @@ # Validate whitespace in and around the JSX opening and closing brackets (react/jsx-tag-spacing) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. Enforce or forbid spaces after the opening bracket, before the closing bracket, before the closing bracket of self-closing elements, and between the angle bracket and slash of JSX closing or self-closing elements. diff --git a/docs/rules/jsx-wrap-multilines.md b/docs/rules/jsx-wrap-multilines.md index 8c2de5a1ea..8e7ff61fdf 100644 --- a/docs/rules/jsx-wrap-multilines.md +++ b/docs/rules/jsx-wrap-multilines.md @@ -1,6 +1,6 @@ # Prevent missing parentheses around multiline JSX (react/jsx-wrap-multilines) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. Wrapping multiline JSX in parentheses can improve readability and/or convenience. diff --git a/docs/rules/no-arrow-function-lifecycle.md b/docs/rules/no-arrow-function-lifecycle.md index 7781838e32..de6eea65ae 100644 --- a/docs/rules/no-arrow-function-lifecycle.md +++ b/docs/rules/no-arrow-function-lifecycle.md @@ -1,6 +1,6 @@ # Lifecycle methods should be methods on the prototype, not class fields (react/no-arrow-function-lifecycle) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. It is not neccessary to use arrow function for lifecycle methods. This makes things harder to test, conceptually less performant (although in practice, performance will not be affected, since most engines will optimize efficiently), and can break hot reloading patterns. diff --git a/docs/rules/no-invalid-html-attribute.md b/docs/rules/no-invalid-html-attribute.md index 4262917cf7..ee6b424f8c 100644 --- a/docs/rules/no-invalid-html-attribute.md +++ b/docs/rules/no-invalid-html-attribute.md @@ -1,6 +1,6 @@ # Prevent usage of invalid attributes (react/no-invalid-html-attribute) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. Some HTML elements have a specific set of valid values for some attributes. For instance the elements: `a`, `area`, `link`, or `form` all have an attribute called `rel`. diff --git a/docs/rules/no-unknown-property.md b/docs/rules/no-unknown-property.md index 632feaddcc..c61389e259 100644 --- a/docs/rules/no-unknown-property.md +++ b/docs/rules/no-unknown-property.md @@ -1,6 +1,6 @@ # Prevent usage of unknown DOM property (react/no-unknown-property) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. In JSX all DOM properties and attributes should be camelCased to be consistent with standard JavaScript style. This can be a possible source of error if you are used to writing plain HTML. diff --git a/docs/rules/prefer-read-only-props.md b/docs/rules/prefer-read-only-props.md index 0f643fbaa8..5d117d7baa 100644 --- a/docs/rules/prefer-read-only-props.md +++ b/docs/rules/prefer-read-only-props.md @@ -1,6 +1,6 @@ # Enforce that props are read-only (react/prefer-read-only-props) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. Using Flow, one can define types for props. This rule enforces that prop types are read-only (covariant). diff --git a/docs/rules/self-closing-comp.md b/docs/rules/self-closing-comp.md index f583dfeb41..16652eed9e 100644 --- a/docs/rules/self-closing-comp.md +++ b/docs/rules/self-closing-comp.md @@ -1,6 +1,6 @@ # Prevent extra closing tags for components without children (react/self-closing-comp) -🔧 This rule is automatically fixable using the `--fix` flag on the command line. +🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line. Components without children can be self-closed to avoid unnecessary extra closing tag. diff --git a/tests/index.js b/tests/index.js index b898dc807a..5728fd3c40 100644 --- a/tests/index.js +++ b/tests/index.js @@ -24,13 +24,11 @@ describe('all rule files should be exported by the plugin', () => { describe('rule documentation files have the correct content', () => { const MESSAGES = { - fixable: - '🔧 This rule is automatically fixable using the `--fix` flag on the command line.', - hasSuggestions: - '💡 This rule provides [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).', + fixable: '🔧 This rule is automatically fixable using the `--fix` [flag](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix) on the command line.', + hasSuggestions: '💡 This rule provides editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).', }; - for (const ruleFile of ruleFiles) { + ruleFiles.forEach((ruleFile) => { const ruleName = path.basename(ruleFile, '.js'); const rule = plugin.rules[ruleName]; const documentPath = path.join('docs/rules', `${ruleName}.md`); @@ -53,17 +51,17 @@ describe('rule documentation files have the correct content', () => { // Ensure that expected notices are present in the correct order. let currentLineNumber = 1; - for (const expectedNotice of expectedNotices) { + expectedNotices.forEach((expectedNotice) => { assert.strictEqual(documentLines[currentLineNumber], '', `${ruleName} includes blank line ahead of ${expectedNotice} notice`); assert.strictEqual(documentLines[currentLineNumber + 1], MESSAGES[expectedNotice], `${ruleName} includes ${expectedNotice} notice`); currentLineNumber += 2; - } + }); // Ensure that unexpected notices are not present. - for (const unexpectedNotice of unexpectedNotices) { + unexpectedNotices.forEach((unexpectedNotice) => { assert.ok(!documentContents.includes(MESSAGES[unexpectedNotice]), `${ruleName} does not include unexpected ${unexpectedNotice} notice`); - } - } + }); + }); }); describe('deprecated rules', () => {