Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
unified-lint-rule
Advanced tools
Readme
unified helper to help make lint rules.
This package is a helper that makes it a bit easier to create linting rules.
You can use this package when you want to make custom lint rules.
This package is ESM only. In Node.js (version 16+), install with npm:
npm install unified-lint-rule
In Deno with esm.sh
:
import {lintRule} from 'https://esm.sh/unified-lint-rule@3'
In browsers with esm.sh
:
<script type="module">
import {lintRule} from 'https://esm.sh/unified-lint-rule@3?bundle'
</script>
import {lintRule} from 'unified-lint-rule'
const remarkLintFileExtension = lintRule(
'remark-lint:file-extension',
function (tree, file, options) {
const ext = file.extname
const option = options || 'md'
if (ext && ext.slice(1) !== option) {
file.message('Incorrect extension: use `' + option + '`')
}
}
)
export default remarkLintFileExtension
This package exports the identifier
lintRule
.
It exports the TypeScript types
Label
,
Meta
, and
Severity
.
There is no default export.
lintRule(meta, rule)
Create a plugin.
Plugin (Plugin
from unified
).
Label
Severity label (TypeScript type);
'off'
: 0
, 'on'
and warn
: 1
, 'error'
: 2
.
type Label = 'error' | 'on' | 'off' | 'warn'
Meta
Rule metadata (TypeScript type).
origin
(string
)
— name of the lint ruleurl
(string
, optional)
— link to documentationRule
Rule (TypeScript type).
tree
(Node
from unist
)
— treefile
(VFile
)
— fileoptions
(any
, optional)
— parameterNothing (Promise<undefined>
or undefined
).
Severity
Severity number (TypeScript type);
0
: 'off'
, 1
: 'on'
and warn
, 2
: 'error'
.
type Severity = 0 | 1 | 2
Projects maintained by the unified collective are compatible with maintained versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
unified-lint-rule@3
,
compatible with Node.js 16.
See contributing.md
in remarkjs/.github
for ways
to get started.
See support.md
for ways to get help.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.
FAQs
unified plugin to make it a bit easier to create linting rules
The npm package unified-lint-rule receives a total of 223,803 weekly downloads. As such, unified-lint-rule popularity was classified as popular.
We found that unified-lint-rule demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.