mirror of
https://github.com/antebudimir/eslint-plugin-vanilla-extract.git
synced 2026-01-02 01:23:33 +00:00
feat 🥁: add no-zero-unit rule
This commit is contained in:
parent
52d38d4477
commit
c1b4e70bd9
19 changed files with 784 additions and 285 deletions
23
src/css-rules/no-zero-unit/rule-definition.ts
Normal file
23
src/css-rules/no-zero-unit/rule-definition.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import type { Rule } from 'eslint';
|
||||
import { createZeroUnitVisitors } from './zero-unit-visitor-creator.js';
|
||||
|
||||
const noZeroUnitRule: Rule.RuleModule = {
|
||||
meta: {
|
||||
type: 'suggestion',
|
||||
docs: {
|
||||
description: 'enforce unitless zero in numeric values',
|
||||
category: 'Stylistic Issues',
|
||||
recommended: true,
|
||||
},
|
||||
fixable: 'code',
|
||||
schema: [],
|
||||
messages: {
|
||||
noZeroUnit: 'Unit with zero value is unnecessary. Use 0 instead.',
|
||||
},
|
||||
},
|
||||
create(context) {
|
||||
return createZeroUnitVisitors(context);
|
||||
},
|
||||
};
|
||||
|
||||
export default noZeroUnitRule;
|
||||
Loading…
Add table
Add a link
Reference in a new issue