0.5.2 • Published 5 months ago

eslint-plugin-object-css v0.5.2

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

eslint-plugin-object-css

NPM Version NPM License

ESLint plugin for object CSS properties order and valid value verification.

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next install eslint-plugin-object-css:

npm install eslint-plugin-object-css --save-dev

Usage

Add object-css to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": ["object-css"]
}

Recommended

As for the recommended rules two rules will be enabled with the recess-order is "warn" valid-value is "error".

  "extends": [
    "plugin:object-css/recommended"
  ]

Rules

If you want to set security levels individually set them in the rules.

{
  "rules": {
    "object-css/recess-order": "warn"
    "object-css/valid-value": "error"
  }
}

※ If you use typescript you will need a suitable parser like typescript-eslint.
If you are using eslint v8 and below set "eslint.useESLintClass": true in vscode's setting.json.

Supports ESLint v9 and higher

npm install @eslint/js typescript-eslint --save-dev

If you are using eslint 9 or higher do not use this useESLintClass.

Example config mjs

The following file is a configuration file that contains recommended settings for TypeScript and eslint.

import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
import objectCss from 'eslint-plugin-object-css'

const eslintConfig = tseslint.config(
  eslint.configs.recommended
  ...tseslint.configs.strict
  objectCss.flatConfigs.recommended
  {
    files: ['**/*.{ts,tsx}']
  }
)

export default eslintConfig

Rule Description

recess-order

It is created based on the sorting of stylelint-config-recess-order.

valid-value

These are not validated as they have names with unique identifiers.
Validation includes other standard properties.

  • animationName
  • counterIncrement
  • counterReset
  • counterSet
  • font
  • fontFamily
  • gridArea
  • gridColumn
  • gridColumnEn
  • gridColumnStart
  • gridRow
  • gridRowEnd
  • gridRowStart
  • listStyleType
  • listStyle
  • transitionProperty
  • transition
  • viewTransitionName
  • willChange

License

ISC.

0.5.2

5 months ago

0.5.1

5 months ago

0.5.0

6 months ago

0.4.1

6 months ago

0.4.0

6 months ago

0.4.3

6 months ago

0.4.2

6 months ago

0.3.0

6 months ago

0.2.0

6 months ago

0.1.1

7 months ago

0.1.0

7 months ago