0.17.0 • Published 10 months ago

@compiled/eslint-plugin v0.17.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
10 months ago

@compiled/eslint-plugin

This plugin contains rules that should be used when working with @compiled/react.

Installation

npm install @compiled/eslint-plugin --save-dev

Usage

Flat Config

Import the @compiled/eslint-plugin and add it to your plugins like so, then configure the rules you want to use under the "Supported rules" section.

import compiled from '@compiled/eslint-plugin';

export default [
  {
    plugins: {
      '@compiled': compiled,
    },
    rules: {
      '@compiled/no-js-xcss': 'error',
    },
  },
];

You can also enable the recommended rules for compiled by extending the flat/recommended config like so:

import compiled from '@compiled/eslint-plugin';

export default [compiled.configs['flat/recommended']];

Legacy Config (.eslintrc)

Add @compiled to the plugins section of your .eslintrc configuration file, then configure the rules you want to use under the rules section.

{
  "plugins": ["@compiled"],
  "rules": {
    "@compiled/no-js-xcss": "error"
  }
}

You can also enable the recommended rules for compiled by adding plugin:@compiled/recommended in extends:

{
+  "extends": ["plugin:@compiled/recommended"],
-  "plugins": ["@compiled"]
}

Supported rules

āœ… Included in the recommended configuration.\ šŸ”§ Automatically fixable by the --fix CLI option.\

NameDescriptionRecommendedFixable
@compiled/jsx-pragmaEnforces a jsx pragma when using the css propšŸ”§
@compiled/local-cx-xcssEnsures the cx() function is only used within the xcss propāœ…
@compiled/no-css-prop-without-css-functionDisallows css prop usages where it is either not wrapped in the css import from @compiled/react or where @compiled cannot determine whether the css import is included at build time.āœ…šŸ”§
@compiled/no-css-tagged-template-expressionDisallows the css tagged template expressionāœ…šŸ”§
@compiled/no-emotion-cssDisallows @emotion usagesšŸ”§
@compiled/no-empty-styled-expressionDisallows any styled expression to be used when passing empty arguments in @compiled/reactāœ…
@compiled/no-exported-cssDisallows css usages from being exportedāœ…
@compiled/no-exported-keyframesDisallows keyframes usages from being exportedāœ…
@compiled/no-invalid-css-mapChecks the validity of a CSS map created through cssMap. This is intended to be used alongside TypeScript's type-checking.āœ…
@compiled/no-js-xcssThe xcss prop is predicated on adhering to the type contract. Using it without TypeScript breaks this contract and thus is not allowed.āœ…
@compiled/no-keyframes-tagged-template-expressionDisallows the keyframes tagged template expressionāœ…šŸ”§
@compiled/no-styled-tagged-template-expressionDisallows the styled tagged template expressionāœ…šŸ”§
@compiled/no-suppress-xcssThe xcss prop is predicated on adhering to the type contract. Supressing it breaks this contract and thus is not allowed.āœ…
@compiled/shorthand-property-sortingPrevent unwanted side-effect by ensuring shorthand properties are always defined before their related longhands.āœ…
0.16.0

10 months ago

0.17.0

10 months ago

0.15.0

10 months ago

0.14.1

11 months ago

0.14.0

12 months ago

0.13.9

1 year ago

0.13.8

1 year ago

0.13.7

1 year ago

0.13.6

2 years ago

0.13.5

2 years ago

0.13.4

2 years ago

0.13.3

2 years ago

0.13.2

2 years ago

0.13.1

2 years ago

0.13.0

2 years ago

0.9.4

2 years ago

0.9.3

2 years ago

0.11.0

2 years ago

0.10.1

2 years ago

0.12.0

2 years ago

0.10.0

2 years ago

0.9.0

2 years ago

0.8.1

2 years ago

0.8.0

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.7.0

2 years ago

0.6.0

3 years ago

0.4.8

3 years ago

0.4.7

3 years ago

0.5.0

3 years ago

0.4.5

3 years ago

0.4.4

3 years ago

0.4.6

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.3.0

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago