GithubHelp home page GithubHelp logo

idered / eslint-plugin-tailwind Goto Github PK

View Code? Open in Web Editor NEW
100.0 6.0 7.0 389 KB

ESLint rules for Tailwind CSS

License: MIT License

JavaScript 98.32% TypeScript 0.41% HTML 1.27%
tailwind-css tailwindcss tailwind eslint eslint-rules

eslint-plugin-tailwind's Issues

Eslint config not detecting tailwind.config

Im having problems setting up tailwind on my React project. I am using eslint, and I wanted to add tailwind and asked me to add it as a project, but then it says it is not correct.
This is the error:
image

This is my eslint config:
image

Support for Tailwind classes in function calls

I love this plugin has changed my workflow a ton and puts some accountability across the team rather than relying on a hyper-local workflow via headwind. Would love to see more dynamic support for this plugin.

ie:

export const Button = ({ label, primary = true, backgroundColor, iconName, ...rest }: ButtonProps) => {
  return (
    <button
      type='submit'
      className={classNames(
        primary ? 'border-transparent bg-blue fill-white text-white hover:bg-blue-600' : 'border-blue bg-white fill-blue text-blue',
        'inline-flex items-center px-2.5 py-1.5 border border-transparent text-xs font-medium rounded shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500',
      )}
      style={{ backgroundColor }}
      {...rest}
    >
      {iconName && <Icon name={iconName} className='w-5 h-5 mr-3 -ml-1' aria-hidden='true' isSolid />}
      {label}
    </button>
  );
};

Would be awesome if the Tailwind classes inside the classNames func would also get sorted like they would if they were not dynamic.

Support prefixed classes

I am using _ prefix and it seems the plugin doesn't recognize the resulting classes like _mr-2.
Can support for prefixes be added?

Svelte support

I would like this plugin to have support for .svelte files
The .svelte files are very similar to .html

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.