0.2.0 • Published 6 years ago

attheme-rules v0.2.0

Weekly downloads
2
License
MIT
Repository
-
Last release
6 years ago

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.