UNPKG

1.85 kBMarkdownView Raw
1# Working on syntaxes
2
3Please help us enhance and debug the [syntaxes](../about/syntaxes.md) we use in stylelint:
4
5- [postcss-css-in-js](https://github.com/stylelint/postcss-css-in-js)
6- [postcss-html](https://github.com/gucong3000/postcss-html)
7- [postcss-less](https://github.com/webschik/postcss-less)
8- [postcss-markdown](https://github.com/stylelint/postcss-markdown)
9- [postcss-sass](https://github.com/AleshaOleg/postcss-sass)
10- [postcss-scss](https://github.com/postcss/postcss-scss)
11
12To contribute to a syntax, you should:
13
141. Familiarize yourself with PostCSS's [how to write custom syntax](https://github.com/postcss/postcss/blob/master/docs/syntax.md) guide.
152. Use the [`syntax: *` labels](https://github.com/stylelint/stylelint/labels?utf8=%E2%9C%93&q=syntax%3A) to identify which syntax is behind an issue.
163. Go to the repository for that syntax.
174. Read their contributing guidelines.
18
19## Workarounds
20
21Fixing bugs in syntaxes can take time. stylelint can work around these bug by turning off autofix for incompatible sources. Autofix can then remain safe to use while contributors try to fix the underlying issue.
22
23### Current workarounds
24
25stylelint currently turns off autofix for sources that contain:
26
27- ~~nested tagged template literals ([issue #4119](https://github.com/stylelint/stylelint/issues/4119))~~
28
29### Add a workaround
30
31To add a new workaround, you should:
32
331. Add code to [`lib/lintSource.js`](https://github.com/stylelint/stylelint/blob/master/lib/lintSource.js) to detect the incompatible pattern.
342. Add a corresponding test to [`lib/__tests__/standalone-fix.test.js`](https://github.com/stylelint/stylelint/blob/master/lib/__tests__/standalone-fix.test.js).
353. Document the workaround in [`docs/developer-guides/syntaxes.md`](https://github.com/stylelint/stylelint/blob/master/docs/developer-guide/syntaxes.md).