attheme-rules
v0.2.0
Published
Rules that test .attheme for possible bugs
Downloads
2
Readme
attheme-rules
A module for testing .attheme's for potentional issues.
Installing
npm i attheme-rules
Using
import Attheme from "attheme-js";
import { testTheme } from "attheme-rules";
const theme = new Attheme(`divider=#ff00ff`);
const testResults = testTheme(theme);
console.log(...testResults);
The output is:
{ type: 'warning',
name: 'purple-variables',
variables: [ 'divider' ] }
Documentation
atthemeRules.testTheme(theme: Attheme): RuleResult[]
type Type = "warning" | "error";
interface RuleResult {
type: Type;
name: string;
variables: string[];
}
Accepts a theme and runs the rules, returns an array of failed rules' results.