Skip to content

Commit 7b059f8

Browse files
committed
Update project info
1 parent 902a7b1 commit 7b059f8

File tree

3 files changed

+125
-4
lines changed

3 files changed

+125
-4
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: 'CodeQL'
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
# The branches below must be a subset of the branches above
8+
branches: [main]
9+
schedule:
10+
- cron: '06 2 * * 5'
11+
12+
jobs:
13+
analyze:
14+
name: Analyze
15+
runs-on: ubuntu-latest
16+
permissions:
17+
security-events: write
18+
steps:
19+
- uses: actions/checkout@v3
20+
- uses: github/codeql-action/init@v2
21+
with:
22+
languages: javascript
23+
- uses: github/codeql-action/analyze@v2

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
66

77
## Unreleased
88

9+
## [1.1.0](https://github.com/torchbox/stylelint-config-torchbox/compare/v1.0.0...v1.1.0) (2022-06-24)
10+
11+
## Features
12+
13+
- Add new at-rule-no-unknown rules for tailwind ([#21](https://github.com/torchbox/stylelint-config-torchbox/pull/21))
14+
915
## [1.0.0](https://github.com/torchbox/stylelint-config-torchbox/compare/v0.5.0...v1.0.0) (2020-11-10)
1016

1117
### Features
@@ -20,6 +26,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
2026

2127
The configuration now mandates stylelint v13, and additionally enforces [`value-keyword-case`](https://stylelint.io/user-guide/rules/value-keyword-case/).
2228

29+
#### Upgrading to v1.0.0
30+
31+
Here are recommended steps:
32+
33+
```bash
34+
# 1. Install the new versions.
35+
npm install --save-dev stylelint@13 stylelint-config-torchbox@^1.0.0
36+
# 2. Attempt to auto-fix any new issue picked up by Stylelint.
37+
npm run lint:css -- --fix
38+
npm run format
39+
# 3. Check if there are remaining issues
40+
npm run lint:css
41+
```
42+
43+
If there are remaining issues, consider a gradual approach: whether you want to update the code, or disable the corresponding rules. This can be done either in the Stylelint configuration, or via [`stylelint-disable` configuration comments](https://stylelint.io/user-guide/ignore-code/). Get the rules reporting issues with: `npm run lint:js -- --formatter tap | grep ruleId | cut -d ':' -f 2 | cut -c 2- | sort | uniq`. For projects strapped for time, disabling all new rules listed above may be a reasonable tradeoff.
44+
2345
## [0.5.0](https://github.com/torchbox/stylelint-config-torchbox/compare/v0.4.0...v0.5.0) (2019-10-10)
2446

2547
### Features
@@ -30,6 +52,10 @@ The configuration now mandates stylelint v13, and additionally enforces [`value-
3052

3153
- Fix `scale-unlimited/declaration-strict-value` being applied twice to `background-color` declarations.
3254

55+
### Upgrading to v0.5.0
56+
57+
Projects considering this release should [skip straight to v1.0.0](#upgrading-to-v100).
58+
3359
## [0.4.0](https://github.com/torchbox/stylelint-config-torchbox/compare/v0.3.0...v0.4.0) (2019-10-08)
3460

3561
### Features
@@ -43,6 +69,10 @@ The configuration now mandates stylelint v13, and additionally enforces [`value-
4369

4470
- Most if not all of the rules changes in this release are breaking changes. Expect breakage on every minor release until the config reaches v1.0.0.
4571

72+
### Upgrading to v0.4.0
73+
74+
Projects considering this release should [skip straight to v1.0.0](#upgrading-to-v100).
75+
4676
## [0.3.0](https://github.com/torchbox/stylelint-config-torchbox/compare/v0.2.0...v0.3.0) (2019-09-23)
4777

4878
### Features
@@ -53,6 +83,10 @@ The configuration now mandates stylelint v13, and additionally enforces [`value-
5383

5484
- Most if not all of the rules changes in this release are breaking changes. Expect breakage on every minor release until the config reaches v1.0.0.
5585

86+
### Upgrading to v0.3.0
87+
88+
Projects considering this release should [skip straight to v1.0.0](#upgrading-to-v100).
89+
5690
## [0.2.0](https://github.com/torchbox/stylelint-config-torchbox/compare/v0.1.0...v0.2.0) (2019-09-23)
5791

5892
### Features
@@ -66,6 +100,10 @@ The configuration now mandates stylelint v13, and additionally enforces [`value-
66100

67101
- Most if not all of the rules changes in this release are breaking changes. Expect breakage on every minor release until the config reaches v1.0.0.
68102

103+
### Upgrading to v0.2.0
104+
105+
Projects considering this release should [skip straight to v1.0.0](#upgrading-to-v100).
106+
69107
## [0.1.0](https://github.com/torchbox/stylelint-config-torchbox/releases/tag/v0.1.0) (2019-08-30)
70108

71109
First release

README.md

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
Install stylelint, and the config:
1010

1111
```sh
12-
npm install --save-dev stylelint@13 stylelint-config-torchbox
13-
12+
npm install --save-dev stylelint@13 [email protected]
1413
```
1514

1615
Then [configure stylelint to use this config](https://stylelint.io/user-guide/configuration/#extends). As a `stylelint.config.js` in the root of your project:
@@ -24,11 +23,72 @@ module.exports = {
2423

2524
### Tips
2625

27-
- Use Stylelint’s [`--report-needless-disables`](https://stylelint.io/user-guide/node-api/#reportneedlessdisables) flag to ensure you do not use more `stylelint-disable` comments than needed.
26+
#### Linting setup for ongoing projects
27+
28+
Review our [CHANGELOG](https://github.com/torchbox/stylelint-config-torchbox/blob/main/CHANGELOG.md) for guidance on how to upgrade a project’s linting to a specific version.
29+
30+
More generally, when retrofitting stricter linting onto an existing project, consider [a gradual approach to linting strictness](https://thib.me/upgrading-to-stricter-eslint-config), so you can start using linting without having to change significant portions of the project’s code. Here is an example, disabling commonly hard-to-retrofit rules:
31+
32+
```js
33+
// Rules which we ideally would want to enforce but are reporting too many issues currently.
34+
const legacyRules = {
35+
'max-nesting-depth': null,
36+
'selector-max-specificity': null,
37+
};
38+
39+
module.exports = {
40+
// See https://github.com/torchbox/stylelint-config-torchbox for rules.
41+
extends: 'stylelint-config-torchbox',
42+
rules: {
43+
...legacyRules,
44+
},
45+
};
46+
```
47+
48+
#### Common CLI flags
49+
50+
We recommend the following `run` script to add to your `package.json`:
51+
52+
```json
53+
"lint:css": "stylelint --report-needless-disables 'src/sass' 'src/vue'"
54+
```
55+
56+
- Use [`--report-needless-disables`](https://stylelint.io/user-guide/node-api/#reportneedlessdisables) flag to ensure you do not use more `stylelint-disable` comments than needed.
57+
- Target specific folders so Stylelint doesn’t attempt to lint e.g. JS or HTML files.
58+
59+
#### `.stylelintignore`
60+
61+
Stylelint supports ignore patterns in a `.stylelintignore` file, however we tend not to use this since we lint all files within a given folder.
62+
63+
### Prettier
64+
65+
This config is [Prettier](https://prettier.io/)-compatible, there isn’t anything extra needed.
66+
67+
### Tailwind
68+
69+
This config should work with [Tailwind](https://tailwindcss.com/) with no adjustments needed. Please submit an issue if that’s not the case.
70+
71+
### pre-commit
72+
73+
Here is a sample setup with our recommended configuration for the [pre-commit](https://pre-commit.com/) pre-commit hook framework:
74+
75+
```yaml
76+
default_language_version:
77+
node: system
78+
repos:
79+
- repo: https://github.com/thibaudcolas/pre-commit-stylelint
80+
rev: v13.13.1
81+
hooks:
82+
- id: stylelint
83+
files: \.(scss|vue)$
84+
additional_dependencies:
85+
86+
87+
```
2888
2989
### Vue
3090
31-
stylelint supports Vue, and our configuration is usable in `.vue` single-file components with no changes. Do make sure linting is configured to check `.vue` files:
91+
Stylelint supports Vue, and our configuration is usable in `.vue` single-file components with no changes. Do make sure linting is configured to check `.vue` files:
3292

3393
- Wherever `stylelint` is manually invoked, make sure to point it both at stylesheets, and Vue components: `stylelint --report-needless-disables './src/sass' './src/vue_components'`.
3494
- With [`stylelint-webpack-plugin`](https://webpack.js.org/plugins/stylelint-webpack-plugin/), use `extensions: ['scss', 'vue'],`.

0 commit comments

Comments
 (0)