Giter VIP home page Giter VIP logo

eslint-plugin-tailwindcss's Introduction

@jarrodldavis/eslint-plugin-tailwindcss

An ESLint plugin to enforce usage of Tailwind CSS utility and component classes.

Install

Install with npm or yarn:

npm install --save-dev @jarrodldavis/eslint-plugin-tailwindcss
yarn add --dev @jarrodldavis/eslint-plugin-tailwindcss

Usage

In your .eslintrc.json (or other .eslintrc.* configuration file):

{
  "plugins": ["@jarrodldavis/tailwindcss"],
  "rules": {
    "@jarrodldavis/tailwindcss/no-unknown-class": "error"
  }
}

The same can be accomplished using the recommended config:

{
  "extends": ["plugin:@jarrodldavis/tailwindcss/recommended"]
}

Rule Options

See the rule documentation for details about using and configuring the no-unknown-classes rule.

eslint-plugin-tailwindcss's People

Contributors

jarrodldavis avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

eslint-plugin-tailwindcss's Issues

ENOBUFS issue with latest @tailwindcss/ui

With @tailwindcss/ui@^0.7.2 (upgraded from 0.6.2):

yarn run v1.22.10
$ eslint .

Oops! Something went wrong! :(

ESLint: 7.13.0

Error: Error while loading rule '@jarrodldavis/tailwindcss/no-unknown-class': spawnSync /usr/local/Cellar/node@12/12.19.0_1/bin/node ENOBUFS
Occurred while linting /Users/jarrodldavis/ghq/github.com/[redacted]/components/CardFieldset.tsx
    at Object.spawnSync (internal/child_process.js:1041:20)
    at spawnSync (child_process.js:621:24)
    at Object.execFileSync (child_process.js:648:15)
    at extractClasses (/Users/jarrodldavis/ghq/github.com/[redacted]/node_modules/@jarrodldavis/eslint-plugin-tailwindcss/dist/lib/util/get-classes.js:27:40)
    at Object.getClasses [as default] (/Users/jarrodldavis/ghq/github.com/[redacted]/node_modules/@jarrodldavis/eslint-plugin-tailwindcss/dist/lib/util/get-classes.js:47:25)
    at Object.create (/Users/jarrodldavis/ghq/github.com/[redacted]/node_modules/@jarrodldavis/eslint-plugin-tailwindcss/dist/lib/rules/no-unknown-class.js:44:42)
    at createRuleListeners (/Users/jarrodldavis/ghq/github.com/[redacted]/node_modules/eslint/lib/linter/linter.js:761:21)
    at /Users/jarrodldavis/ghq/github.com/[redacted]/node_modules/eslint/lib/linter/linter.js:931:31
    at Array.forEach (<anonymous>)
    at runRules (/Users/jarrodldavis/ghq/github.com/[redacted]/node_modules/eslint/lib/linter/linter.js:876:34)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.