Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b9d6c28
feat: add no-property-in-node rule
JoshuaKGoldberg Feb 5, 2024
8cfaf6d
Add ☑️ emoji for recommended-type-checked
JoshuaKGoldberg Feb 5, 2024
4d163e1
tests: valid before invalid
JoshuaKGoldberg Feb 5, 2024
d62539d
Also check for whether the node has a 'type'
JoshuaKGoldberg Feb 5, 2024
3575644
Added docs and example to isAstNodeType
JoshuaKGoldberg Feb 5, 2024
e42c075
Expanded rule details
JoshuaKGoldberg Feb 5, 2024
2a94dcb
Add more valid test cases
JoshuaKGoldberg Feb 5, 2024
4d5d332
Merge branch 'main'
JoshuaKGoldberg Feb 5, 2024
755cc08
Fixed test path to fixtures
JoshuaKGoldberg Feb 5, 2024
d76b08a
Use parserOptions.project: true for eslint-remote-tester on TS files
JoshuaKGoldberg Feb 5, 2024
5913127
nit: avoid shadowing name for typePart
JoshuaKGoldberg Feb 5, 2024
d45695d
<!-- omit from toc -->
JoshuaKGoldberg Feb 5, 2024
532925d
Downgraded to typescript-eslint@v5
JoshuaKGoldberg Feb 6, 2024
6b60ab0
Also remove @typescript-eslint/utils
JoshuaKGoldberg Feb 6, 2024
89aafda
Or rather, make @typescript-eslint/utils a -D
JoshuaKGoldberg Feb 6, 2024
1d570e8
Remove ts-api-utils too
JoshuaKGoldberg Feb 6, 2024
1ec0c2a
Removed recommended-type-checked
JoshuaKGoldberg Feb 6, 2024
de370b0
Removed README.md section too
JoshuaKGoldberg Feb 6, 2024
18b205a
Removed eslint-remote-tester.config.js parserOptions.project too
JoshuaKGoldberg Feb 6, 2024
8d68dc9
Redid README.md presets table
JoshuaKGoldberg Feb 6, 2024
d8dc1a0
Added all-type-checked
JoshuaKGoldberg Feb 6, 2024
d8cc468
Removed file notice
JoshuaKGoldberg Feb 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add ☑️ emoji for recommended-type-checked
  • Loading branch information
JoshuaKGoldberg committed Feb 5, 2024
commit 8cfaf6d48f5aa3737e81d04d13c0101ab5273f1c
1 change: 1 addition & 0 deletions .eslint-doc-generatorrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

/** @type {import('eslint-doc-generator').GenerateOptions} */
module.exports = {
configEmoji: [['recommended-type-checked', '☑️']],
ignoreConfig: [
'all',
'rules',
Expand Down
63 changes: 32 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,46 +94,47 @@ module.exports = {

💼 [Configurations](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets) enabled in.\
✅ Set in the `recommended` [configuration](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets).\
☑️ Set in the `recommended-type-checked` [configuration](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets).\
🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\
💡 Manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).\
💭 Requires type information.

### Rules

| Name                          | Description | 💼 | 🔧 | 💡 | 💭 |
| :--------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------- | :------------------------------------ | :- | :- | :- |
| [fixer-return](docs/rules/fixer-return.md) | require fixer functions to return a fix | ✅ ![badge-recommended-type-checked][] | | | |
| [meta-property-ordering](docs/rules/meta-property-ordering.md) | enforce the order of meta properties | | 🔧 | | |
| [no-deprecated-context-methods](docs/rules/no-deprecated-context-methods.md) | disallow usage of deprecated methods on rule context objects | ✅ ![badge-recommended-type-checked][] | 🔧 | | |
| [no-deprecated-report-api](docs/rules/no-deprecated-report-api.md) | disallow the version of `context.report()` with multiple arguments | ✅ ![badge-recommended-type-checked][] | 🔧 | | |
| [no-missing-message-ids](docs/rules/no-missing-message-ids.md) | disallow `messageId`s that are missing from `meta.messages` | ✅ ![badge-recommended-type-checked][] | | | |
| [no-missing-placeholders](docs/rules/no-missing-placeholders.md) | disallow missing placeholders in rule report messages | ✅ ![badge-recommended-type-checked][] | | | |
| [no-property-in-node](docs/rules/no-property-in-node.md) | disallow using `in` to narrow node types instead of looking at properties | ![badge-recommended-type-checked][] | | | 💭 |
| [no-unused-message-ids](docs/rules/no-unused-message-ids.md) | disallow unused `messageId`s in `meta.messages` | ✅ ![badge-recommended-type-checked][] | | | |
| [no-unused-placeholders](docs/rules/no-unused-placeholders.md) | disallow unused placeholders in rule report messages | ✅ ![badge-recommended-type-checked][] | | | |
| [no-useless-token-range](docs/rules/no-useless-token-range.md) | disallow unnecessary calls to `sourceCode.getFirstToken()` and `sourceCode.getLastToken()` | ✅ ![badge-recommended-type-checked][] | 🔧 | | |
| [prefer-message-ids](docs/rules/prefer-message-ids.md) | require using `messageId` instead of `message` or `desc` to report rule violations | ✅ ![badge-recommended-type-checked][] | | | |
| [prefer-object-rule](docs/rules/prefer-object-rule.md) | disallow function-style rules | ✅ ![badge-recommended-type-checked][] | 🔧 | | |
| [prefer-placeholders](docs/rules/prefer-placeholders.md) | require using placeholders for dynamic report messages | | | | |
| [prefer-replace-text](docs/rules/prefer-replace-text.md) | require using `replaceText()` instead of `replaceTextRange()` | | | | |
| [report-message-format](docs/rules/report-message-format.md) | enforce a consistent format for rule report messages | | | | |
| [require-meta-docs-description](docs/rules/require-meta-docs-description.md) | require rules to implement a `meta.docs.description` property with the correct format | | | | |
| [require-meta-docs-url](docs/rules/require-meta-docs-url.md) | require rules to implement a `meta.docs.url` property | | 🔧 | | |
| [require-meta-fixable](docs/rules/require-meta-fixable.md) | require rules to implement a `meta.fixable` property | ✅ ![badge-recommended-type-checked][] | | | |
| [require-meta-has-suggestions](docs/rules/require-meta-has-suggestions.md) | require suggestable rules to implement a `meta.hasSuggestions` property | ✅ ![badge-recommended-type-checked][] | 🔧 | | |
| [require-meta-schema](docs/rules/require-meta-schema.md) | require rules to implement a `meta.schema` property | ✅ ![badge-recommended-type-checked][] | | 💡 | |
| [require-meta-type](docs/rules/require-meta-type.md) | require rules to implement a `meta.type` property | ✅ ![badge-recommended-type-checked][] | | | |
| Name                          | Description | 💼 | 🔧 | 💡 | 💭 |
| :--------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------- | :--- | :- | :- | :- |
| [fixer-return](docs/rules/fixer-return.md) | require fixer functions to return a fix | ✅ ☑️ | | | |
| [meta-property-ordering](docs/rules/meta-property-ordering.md) | enforce the order of meta properties | | 🔧 | | |
| [no-deprecated-context-methods](docs/rules/no-deprecated-context-methods.md) | disallow usage of deprecated methods on rule context objects | ✅ ☑️ | 🔧 | | |
| [no-deprecated-report-api](docs/rules/no-deprecated-report-api.md) | disallow the version of `context.report()` with multiple arguments | ✅ ☑️ | 🔧 | | |
| [no-missing-message-ids](docs/rules/no-missing-message-ids.md) | disallow `messageId`s that are missing from `meta.messages` | ✅ ☑️ | | | |
| [no-missing-placeholders](docs/rules/no-missing-placeholders.md) | disallow missing placeholders in rule report messages | ✅ ☑️ | | | |
| [no-property-in-node](docs/rules/no-property-in-node.md) | disallow using `in` to narrow node types instead of looking at properties | ☑️ | | | 💭 |
| [no-unused-message-ids](docs/rules/no-unused-message-ids.md) | disallow unused `messageId`s in `meta.messages` | ✅ ☑️ | | | |
| [no-unused-placeholders](docs/rules/no-unused-placeholders.md) | disallow unused placeholders in rule report messages | ✅ ☑️ | | | |
| [no-useless-token-range](docs/rules/no-useless-token-range.md) | disallow unnecessary calls to `sourceCode.getFirstToken()` and `sourceCode.getLastToken()` | ✅ ☑️ | 🔧 | | |
| [prefer-message-ids](docs/rules/prefer-message-ids.md) | require using `messageId` instead of `message` or `desc` to report rule violations | ✅ ☑️ | | | |
| [prefer-object-rule](docs/rules/prefer-object-rule.md) | disallow function-style rules | ✅ ☑️ | 🔧 | | |
| [prefer-placeholders](docs/rules/prefer-placeholders.md) | require using placeholders for dynamic report messages | | | | |
| [prefer-replace-text](docs/rules/prefer-replace-text.md) | require using `replaceText()` instead of `replaceTextRange()` | | | | |
| [report-message-format](docs/rules/report-message-format.md) | enforce a consistent format for rule report messages | | | | |
| [require-meta-docs-description](docs/rules/require-meta-docs-description.md) | require rules to implement a `meta.docs.description` property with the correct format | | | | |
| [require-meta-docs-url](docs/rules/require-meta-docs-url.md) | require rules to implement a `meta.docs.url` property | | 🔧 | | |
| [require-meta-fixable](docs/rules/require-meta-fixable.md) | require rules to implement a `meta.fixable` property | ✅ ☑️ | | | |
| [require-meta-has-suggestions](docs/rules/require-meta-has-suggestions.md) | require suggestable rules to implement a `meta.hasSuggestions` property | ✅ ☑️ | 🔧 | | |
| [require-meta-schema](docs/rules/require-meta-schema.md) | require rules to implement a `meta.schema` property | ✅ ☑️ | | 💡 | |
| [require-meta-type](docs/rules/require-meta-type.md) | require rules to implement a `meta.type` property | ✅ ☑️ | | | |

### Tests

| Name                        | Description | 💼 | 🔧 | 💡 | 💭 |
| :----------------------------------------------------------------------- | :--------------------------------------------------------------------------- | :------------------------------------ | :- | :- | :- |
| [consistent-output](docs/rules/consistent-output.md) | enforce consistent use of `output` assertions in rule tests | ✅ ![badge-recommended-type-checked][] | | | |
| [no-identical-tests](docs/rules/no-identical-tests.md) | disallow identical tests | ✅ ![badge-recommended-type-checked][] | 🔧 | | |
| [no-only-tests](docs/rules/no-only-tests.md) | disallow the test case property `only` | ✅ ![badge-recommended-type-checked][] | | 💡 | |
| [prefer-output-null](docs/rules/prefer-output-null.md) | disallow invalid RuleTester test cases where the `output` matches the `code` | ✅ ![badge-recommended-type-checked][] | 🔧 | | |
| [test-case-property-ordering](docs/rules/test-case-property-ordering.md) | require the properties of a test case to be placed in a consistent order | | 🔧 | | |
| [test-case-shorthand-strings](docs/rules/test-case-shorthand-strings.md) | enforce consistent usage of shorthand strings for test cases with no options | | 🔧 | | |
| Name                        | Description | 💼 | 🔧 | 💡 | 💭 |
| :----------------------------------------------------------------------- | :--------------------------------------------------------------------------- | :--- | :- | :- | :- |
| [consistent-output](docs/rules/consistent-output.md) | enforce consistent use of `output` assertions in rule tests | ✅ ☑️ | | | |
| [no-identical-tests](docs/rules/no-identical-tests.md) | disallow identical tests | ✅ ☑️ | 🔧 | | |
| [no-only-tests](docs/rules/no-only-tests.md) | disallow the test case property `only` | ✅ ☑️ | | 💡 | |
| [prefer-output-null](docs/rules/prefer-output-null.md) | disallow invalid RuleTester test cases where the `output` matches the `code` | ✅ ☑️ | 🔧 | | |
| [test-case-property-ordering](docs/rules/test-case-property-ordering.md) | require the properties of a test case to be placed in a consistent order | | 🔧 | | |
| [test-case-shorthand-strings](docs/rules/test-case-shorthand-strings.md) | enforce consistent usage of shorthand strings for test cases with no options | | 🔧 | | |

<!-- end auto-generated rules list -->

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/consistent-output.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Enforce consistent use of `output` assertions in rule tests (`eslint-plugin/consistent-output`)

💼 This rule is enabled in the following [configs](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets): ✅ `recommended`, `recommended-type-checked`.
💼 This rule is enabled in the following [configs](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets): ✅ `recommended`, ☑️ `recommended-type-checked`.

<!-- end auto-generated rule header -->

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/fixer-return.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Require fixer functions to return a fix (`eslint-plugin/fixer-return`)

💼 This rule is enabled in the following [configs](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets): ✅ `recommended`, `recommended-type-checked`.
💼 This rule is enabled in the following [configs](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets): ✅ `recommended`, ☑️ `recommended-type-checked`.

<!-- end auto-generated rule header -->

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-deprecated-context-methods.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Disallow usage of deprecated methods on rule context objects (`eslint-plugin/no-deprecated-context-methods`)

💼 This rule is enabled in the following [configs](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets): ✅ `recommended`, `recommended-type-checked`.
💼 This rule is enabled in the following [configs](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets): ✅ `recommended`, ☑️ `recommended-type-checked`.

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-deprecated-report-api.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Disallow the version of `context.report()` with multiple arguments (`eslint-plugin/no-deprecated-report-api`)

💼 This rule is enabled in the following [configs](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets): ✅ `recommended`, `recommended-type-checked`.
💼 This rule is enabled in the following [configs](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets): ✅ `recommended`, ☑️ `recommended-type-checked`.

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-identical-tests.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Disallow identical tests (`eslint-plugin/no-identical-tests`)

💼 This rule is enabled in the following [configs](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets): ✅ `recommended`, `recommended-type-checked`.
💼 This rule is enabled in the following [configs](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets): ✅ `recommended`, ☑️ `recommended-type-checked`.

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-missing-message-ids.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Disallow `messageId`s that are missing from `meta.messages` (`eslint-plugin/no-missing-message-ids`)

💼 This rule is enabled in the following [configs](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets): ✅ `recommended`, `recommended-type-checked`.
💼 This rule is enabled in the following [configs](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets): ✅ `recommended`, ☑️ `recommended-type-checked`.

<!-- end auto-generated rule header -->

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-missing-placeholders.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Disallow missing placeholders in rule report messages (`eslint-plugin/no-missing-placeholders`)

💼 This rule is enabled in the following [configs](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets): ✅ `recommended`, `recommended-type-checked`.
💼 This rule is enabled in the following [configs](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets): ✅ `recommended`, ☑️ `recommended-type-checked`.

<!-- end auto-generated rule header -->

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-only-tests.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Disallow the test case property `only` (`eslint-plugin/no-only-tests`)

💼 This rule is enabled in the following [configs](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets): ✅ `recommended`, `recommended-type-checked`.
💼 This rule is enabled in the following [configs](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets): ✅ `recommended`, ☑️ `recommended-type-checked`.

💡 This rule is manually fixable by [editor suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions).

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-property-in-node.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Disallow using `in` to narrow node types instead of looking at properties (`eslint-plugin/no-property-in-node`)

💼 This rule is enabled in the `recommended-type-checked` [config](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets).
💼 This rule is enabled in the ☑️ `recommended-type-checked` [config](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets).

💭 This rule requires type information.

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-unused-message-ids.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Disallow unused `messageId`s in `meta.messages` (`eslint-plugin/no-unused-message-ids`)

💼 This rule is enabled in the following [configs](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets): ✅ `recommended`, `recommended-type-checked`.
💼 This rule is enabled in the following [configs](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets): ✅ `recommended`, ☑️ `recommended-type-checked`.

<!-- end auto-generated rule header -->

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-unused-placeholders.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Disallow unused placeholders in rule report messages (`eslint-plugin/no-unused-placeholders`)

💼 This rule is enabled in the following [configs](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets): ✅ `recommended`, `recommended-type-checked`.
💼 This rule is enabled in the following [configs](https://github.com/eslint-community/eslint-plugin-eslint-plugin#presets): ✅ `recommended`, ☑️ `recommended-type-checked`.

<!-- end auto-generated rule header -->

Expand Down
Loading