|
| 1 | +import { readableMultilineString } from 'src/utils/string'; |
| 2 | +import { Config } from './config.interface'; |
| 3 | + |
| 4 | +const stylelintConfig = readableMultilineString` |
| 5 | + { |
| 6 | + "extends": [ |
| 7 | + "stylelint-config-standard", |
| 8 | + "stylelint-config-rational-order-fix" |
| 9 | + ], |
| 10 | + "plugins": [ |
| 11 | + "stylelint-order", |
| 12 | + "stylelint-config-rational-order-fix/plugin" |
| 13 | + ], |
| 14 | + "rules": { |
| 15 | + "declaration-empty-line-before": null, |
| 16 | + "no-empty-first-line": null, |
| 17 | + "order/properties-order": [], |
| 18 | + "plugin/rational-order": [true, { |
| 19 | + "border-in-box-model": false, |
| 20 | + "empty-line-between-groups": false |
| 21 | + }] |
| 22 | + }, |
| 23 | + "overrides": [ |
| 24 | + { |
| 25 | + "files": ["**/*.{js,jsx,ts,tsx}"], |
| 26 | + "customSyntax": "@stylelint/postcss-css-in-js" |
| 27 | + } |
| 28 | + ] |
| 29 | + } |
| 30 | +`; |
| 31 | + |
| 32 | +const stylelintIgnore = readableMultilineString` |
| 33 | + node_modules |
| 34 | + .next |
| 35 | + build |
| 36 | + dist |
| 37 | +`; |
| 38 | + |
| 39 | +export const reactTsConfig: Config = { |
| 40 | + stylelintConfig, |
| 41 | + stylelintIgnore, |
| 42 | + devDependencies: [ |
| 43 | + 'stylelint', |
| 44 | + 'stylelint-config-standard', |
| 45 | + 'stylelint-order', |
| 46 | + 'stylelint-config-rational-order-fix', |
| 47 | + '@stylelint/postcss-css-in-js', |
| 48 | + ], |
| 49 | + scripts: [ |
| 50 | + { name: 'csslint', script: 'stylelint "src/**/*.{css,js,jsx,ts,tsx}"' }, |
| 51 | + { name: 'csslint:fix', script: 'stylelint "src/**/*.{css,js,jsx,ts,tsx}" --fix' }, |
| 52 | + ], |
| 53 | +}; |
0 commit comments