Giter Club home page Giter Club logo

Comments (8)

meirroth avatar meirroth commented on August 22, 2024 3

This module is designed to be easily extensible, so I don't see why it should include rules for specific libraries.

from eslint.

antfu avatar antfu commented on August 22, 2024 3

It could be extended by the tailwind module with the module hook. It's out-of-scope of this module.

from eslint.

gwynhokkers avatar gwynhokkers commented on August 22, 2024 2

Just in case anyone stumbles across this, you can easily use the module by including it in the eslint.config
npm i eslint-plugin-tailwindcss

import tailwind from 'eslint-plugin-tailwindcss'
import withNuxt from './.nuxt/eslint.config.mjs'

export default withNuxt(
	{
		rules: {
		// Global
		// Vue
			'vue/multi-word-component-names': 0,
			'vue/max-attributes-per-line': [
				'warn',
				{
					singleline: {
						max: 5
					}
				}
			],
			'vue/no-v-html': 0
		}
	},
	...tailwind.configs['flat/recommended']
)

from eslint.

dev-cetus avatar dev-cetus commented on August 22, 2024 1

hey!
on the tailwind page they offer the module for prettier, but there is also one for eslint -> https://www.npmjs.com/package/eslint-plugin-tailwindcss

from eslint.

dev-cetus avatar dev-cetus commented on August 22, 2024 1

Hi @shinGangan !
Yes you're right, it will only be useful for tailwindcss users, as this plugin is only useful for eslint users. I suggest tailwindcss because that's what I use, but if unocss, bootstrap and other ui frameworks offer a class sorter, then they should be added.

from eslint.

meirroth avatar meirroth commented on August 22, 2024

Hey @dev-cetus, the class sorter is a prettier plugin, so not handled with eslint.

To get it working once you've integrated prettier with eslint, you simply add the following line to your .prettierrc file:

  "plugins": ["prettier-plugin-tailwindcss"]

from eslint.

shinGangan avatar shinGangan commented on August 22, 2024

Hi @dev-cetus , thank you for the great suggestion. I have one question regarding this issue.

  • Q. Will all Nuxt users benefit from adding this plugin?

The addition of this plugin is nice for Tailwind CSS users, but unnecessary for users who don't use Tailwind CSS.
I use Nuxt UI so I can benefit from it, but not all Nuxt users.

It is questionable to add rules as official modules that do not benefit all Nuxt users.

from eslint.

shinGangan avatar shinGangan commented on August 22, 2024

@dev-cetus , thanks for comment!

As a web application developer, I agree with this opinion.
If the rules are used in other UI frameworks, I would be happy if they were introduced, as the settings would be reduced.

I suggest tailwindcss because that's what I use, but if unocss, bootstrap and other ui frameworks offer a class sorter, then they should be added.

However, I think it is better to consider topics related to Nuxt Framework and topics related to UI Framework separately from a maintenance perspective.
I think it's better for each UI Framework user to set their own rules.

from eslint.

Related Issues (20)

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.