eslint-plugin-primer-react 6.1.6 → 6.2.0-rc.09a2b48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # eslint-plugin-primer-react
2
2
 
3
+ ## 6.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#258](https://github.com/primer/eslint-plugin-primer-react/pull/258) [`83f29f3`](https://github.com/primer/eslint-plugin-primer-react/commit/83f29f339999b9c21d95167bcc2680c1797cbab6) Thanks [@keithamus](https://github.com/keithamus)! - Add enforce-css-module-identifier-casing rule
8
+
3
9
  ## 6.1.6
4
10
 
5
11
  ### Patch Changes
@@ -0,0 +1,39 @@
1
+ # Enforce CSS Module Identifier Casing (enforce-css-module-identifier-casing)
2
+
3
+ CSS Modules should expose class names written in PascalCase.
4
+
5
+ ## Rule details
6
+
7
+ This rule disallows the use of any CSS Module property that does not match the desired casing.
8
+
9
+ 👎 Examples of **incorrect** code for this rule:
10
+
11
+ ```jsx
12
+ /* eslint primer-react/enforce-css-module-identifier-casing: "error" */
13
+ import {Button} from '@primer/react'
14
+ import classes from './some.module.css'
15
+
16
+ <Button className={classes.button} />
17
+ <Button className={classes['button']} />
18
+ <Button className={clsx(classes.button)} />
19
+
20
+ let ButtonClass = "button"
21
+ <Button className={clsx(classes[ButtonClass])} />
22
+ ```
23
+
24
+ 👍 Examples of **correct** code for this rule:
25
+
26
+ ```jsx
27
+ /* eslint primer-react/enforce-css-module-identifier-casing: "error" */
28
+ import {Button} from '@primer/react'
29
+ import classes from './some.module.css'
30
+ ;<Button className={classes.Button} />
31
+ ```
32
+
33
+ ## Options
34
+
35
+ - `casing` (default: `'pascal'`)
36
+
37
+ By default, the `enforce-css-module-identifier-casing` rule will check for identifiers matching PascalCase.
38
+ Changing this to `'camel'` will instead enforce camelCasing rules. Changing this to `'kebab'` will instead
39
+ enforce kebab-casing rules.