You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@griffel/eslint-plugin

Package Overview
Dependencies
Maintainers
6
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@griffel/eslint-plugin

ESLint plugin with lint rules for Griffel

2.0.0
latest
Source
npmnpm
Version published
Maintainers
6
Created
Source

ESLint plugin for Griffel

ESLint plugin to follow best practices and anticipate common mistakes when writing styles with Griffel

Install

yarn add --dev @griffel/eslint-plugin
# or
npm install --save-dev @griffel/eslint-plugin

Usage

Add @griffel to the plugins section and plugin:@griffel/recommended to the extends section of your .eslintrc configuration file:

{
  "plugins": ["@griffel"],
  "extends": ["plugin:@griffel/recommended"]
}

Shareable configurations

This plugin exports recommended configuration that enforce good practices, but you can choose to use only the ones that are necessary for your use case:

{
  "plugins": ["@griffel"],
  "rules": {
    "@griffel/hook-naming": "error",
    "@griffel/no-shorthands": "error",
    "@griffel/pseudo-element-naming": "error"
  }
}

You can find more info about enabled rules in the Supported Rules section below.

Supported Rules

Key: 🔧 = fixable

NameDescription🔧
@griffel/hook-namingEnsure that hooks returned by the makeStyles() function start with "use"
@griffel/no-invalid-shorthand-argumentsAll shorthands must not use space separators, and instead pass in multiple arguments
@griffel/no-shorthandsEnforce usage of CSS longhands
@griffel/styles-fileEnsures that all makeStyles() and makeResetStyles() calls are placed in a .styles.js or .styles.ts file
@griffel/pseudo-element-namingEnsures that all Pseudo Elements start with two colons
@griffel/top-level-stylesEnsures that all makeStyles(), makeResetStyles() and makeStaticStyles() calls are written in the top level of a file to discourage developer misuse.
@griffel/no-deprecated-shorthandsEnsure that deprecated shorthand functions are not used

FAQs

Package last updated on 13 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts