Skip to content

Commit

Permalink
fix(no-inspect): disable recommended & add description
Browse files Browse the repository at this point in the history
  • Loading branch information
mikededo committed Oct 10, 2024
1 parent 0d42656 commit 0fe07d7
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ These rules relate to better ways of doing things to help you avoid problems:
| [svelte/no-ignored-unsubscribe](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-ignored-unsubscribe/) | disallow ignoring the unsubscribe method returned by the `subscribe()` on Svelte stores. | |
| [svelte/no-immutable-reactive-statements](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-immutable-reactive-statements/) | disallow reactive statements that don't reference reactive values. | |
| [svelte/no-inline-styles](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-inline-styles/) | disallow attributes and directives that produce inline styles | |
| [svelte/no-inspect](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-inspect/) | (no description) | :star: |
| [svelte/no-inspect](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-inspect/) | Warns against the use of `$inspect` directive | |
| [svelte/no-reactive-functions](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-reactive-functions/) | it's not necessary to define functions in reactive statements | :bulb: |
| [svelte/no-reactive-literals](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-reactive-literals/) | don't assign literal values in reactive statements | :bulb: |
| [svelte/no-svelte-internal](https://sveltejs.github.io/eslint-plugin-svelte/rules/no-svelte-internal/) | svelte/internal will be removed in Svelte 6. | |
Expand Down
2 changes: 1 addition & 1 deletion docs/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ These rules relate to better ways of doing things to help you avoid problems:
| [svelte/no-ignored-unsubscribe](./rules/no-ignored-unsubscribe.md) | disallow ignoring the unsubscribe method returned by the `subscribe()` on Svelte stores. | |
| [svelte/no-immutable-reactive-statements](./rules/no-immutable-reactive-statements.md) | disallow reactive statements that don't reference reactive values. | |
| [svelte/no-inline-styles](./rules/no-inline-styles.md) | disallow attributes and directives that produce inline styles | |
| [svelte/no-inspect](./rules/no-inspect.md) | (no description) | :star: |
| [svelte/no-inspect](./rules/no-inspect.md) | Warns against the use of `$inspect` directive | |
| [svelte/no-reactive-functions](./rules/no-reactive-functions.md) | it's not necessary to define functions in reactive statements | :bulb: |
| [svelte/no-reactive-literals](./rules/no-reactive-literals.md) | don't assign literal values in reactive statements | :bulb: |
| [svelte/no-svelte-internal](./rules/no-svelte-internal.md) | svelte/internal will be removed in Svelte 6. | |
Expand Down
5 changes: 2 additions & 3 deletions docs/rules/no-inspect.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
pageClass: 'rule-details'
sidebarDepth: 0
title: 'svelte/no-inspect'
description: ''
description: 'Warns against the use of `$inspect` directive'
---

# svelte/no-inspect

>
> Warns against the use of `$inspect` directive
- :exclamation: <badge text="This rule has not been released yet." vertical="middle" type="error"> **_This rule has not been released yet._** </badge>
- :gear: This rule is included in `"plugin:svelte/recommended"`.

## :book: Rule Details

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const config: Linter.Config[] = [
'svelte/no-dupe-style-properties': 'error',
'svelte/no-dynamic-slot-name': 'error',
'svelte/no-inner-declarations': 'error',
'svelte/no-inspect': 'warn',
'svelte/no-not-function-handler': 'error',
'svelte/no-object-in-text-mustaches': 'error',
'svelte/no-shorthand-style-property-overrides': 'error',
Expand Down
1 change: 0 additions & 1 deletion packages/eslint-plugin-svelte/src/configs/recommended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const config: Linter.LegacyConfig = {
'svelte/no-dupe-style-properties': 'error',
'svelte/no-dynamic-slot-name': 'error',
'svelte/no-inner-declarations': 'error',
'svelte/no-inspect': 'warn',
'svelte/no-not-function-handler': 'error',
'svelte/no-object-in-text-mustaches': 'error',
'svelte/no-shorthand-style-property-overrides': 'error',
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-plugin-svelte/src/rule-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ export interface RuleOptions {
*/
'svelte/no-inner-declarations'?: Linter.RuleEntry<SvelteNoInnerDeclarations>
/**
* Warns against the use of `$inspect` directive
* @see https://sveltejs.github.io/eslint-plugin-svelte/rules/no-inspect/
*/
'svelte/no-inspect'?: Linter.RuleEntry<[]>
Expand Down
5 changes: 3 additions & 2 deletions packages/eslint-plugin-svelte/src/rules/no-inspect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import { createRule } from '../utils';
export default createRule('no-inspect', {
meta: {
docs: {
description: '',
description: 'Warns against the use of `$inspect` directive',
category: 'Best Practices',
recommended: true,
// TODO: Enable recommended in major version

Check warning on line 10 in packages/eslint-plugin-svelte/src/rules/no-inspect.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected 'todo' comment: 'TODO: Enable recommended in major...'
recommended: false,
default: 'warn'
},
schema: [],
Expand Down

0 comments on commit 0fe07d7

Please sign in to comment.