forked from azat-io/eslint-plugin-perfectionist
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
title: yes | ||
description: Just passes | ||
--- | ||
|
||
<script setup lang="ts"> | ||
import CodeEditor from '../../.vitepress/theme/components/code-editor.vue'; | ||
import {ruleName, presetConfigs, initialText, fakeLint} from '../../src/sample-code/yes.js'; | ||
</script> | ||
|
||
> Silence is a source of great strength. — Lao Tzu | ||
# Enforce nothing (`dont/yes`) | ||
|
||
<!-- end auto-generated rule header --> | ||
|
||
## 🔧 Config | ||
|
||
```js | ||
{ rules: { 'dont/yes': 2 } } | ||
``` | ||
|
||
## 🔗 See also | ||
|
||
- [node-noop](https://github.com/euank/node-noop): used in the implementation of this rule. | ||
|
||
## 🧑💻 Demo | ||
|
||
<CodeEditor :rule="ruleName" :text="initialText" :presetConfigs="presetConfigs" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// @ts-expect-error - required for node-noop | ||
import noop from 'node-noop' | ||
|
||
import type { RuleListener } from '../utils/eslint-types/Rule.js' | ||
|
||
import { createEslintRule } from '../utils/create-eslint-rule.js' | ||
type MESSAGE_ID = 'yes' | ||
|
||
type Options = [] | ||
|
||
export const RULE_NAME = 'yes' | ||
|
||
export default createEslintRule<Options, MESSAGE_ID>({ | ||
name: RULE_NAME, | ||
meta: { | ||
type: 'problem', | ||
docs: { | ||
description: 'enforce nothing', | ||
}, | ||
schema: [ | ||
{ | ||
type: 'object', | ||
properties: {}, | ||
}, | ||
], | ||
messages: { | ||
yes: 'yes', | ||
}, | ||
}, | ||
defaultOptions: [], | ||
create: (): RuleListener => { | ||
noop() | ||
return { | ||
} | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import type { PresetConfig } from './presets.js' | ||
|
||
export const ruleName = 'yes' | ||
|
||
export const presetConfigs = [] satisfies PresetConfig[] | ||
|
||
export const initialText = `// just pass | ||
` | ||
|
||
export const fakeLint = async (code: string) => { | ||
return { | ||
fix: { | ||
fixed: false, | ||
messages: [], | ||
output: code, | ||
}, | ||
verify: [], | ||
} | ||
} |