Skip to content

Commit 08d92ab

Browse files
authored
Enforce accessibility-related rules with stylelint-a11y (#2) (#3)
1 parent b0c4a87 commit 08d92ab

File tree

8 files changed

+49
-1
lines changed

8 files changed

+49
-1
lines changed

CHANGELOG.md

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

77
## Unreleased
88

9+
### Features
10+
11+
- Enforce accessibility-related rules with [stylelint-a11y](https://github.com/YozhikM/stylelint-a11y) ([#2](https://github.com/torchbox/stylelint-config-torchbox/issues/2)).
12+
13+
### BREAKING CHANGES
14+
15+
- 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.
16+
917
## [0.3.0](https://github.com/torchbox/stylelint-config-torchbox/compare/v0.2.0...v0.3.0) (2019-09-23)
1018

1119
### Features

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ To get the most out of this config, it is assumed that projects have the followi
3939
>
4040
> - [`stylelint-scss`](https://github.com/kristerkari/stylelint-scss)
4141
> - [`stylelint-order`](https://github.com/hudochenkov/stylelint-order)
42+
> - [`stylelint-a11y`](https://github.com/YozhikM/stylelint-a11y)
4243
> - [`stylelint-config-standard`](https://github.com/stylelint/stylelint-config-standard)
4344
> - [`stylelint-config-prettier`](https://github.com/prettier/stylelint-config-prettier)
4445
@@ -69,6 +70,11 @@ To get the most out of this config, it is assumed that projects have the followi
6970
- [`scss/dollar-variable-no-missing-interpolation`](https://github.com/kristerkari/stylelint-scss#readme)
7071
- [`scss/at-mixin-argumentless-call-parentheses`](https://github.com/kristerkari/stylelint-scss#readme): `always`
7172
- [`order/order`](https://github.com/hudochenkov/stylelint-order): `dollar-variables, custom-properties, type: at-rule, hasBlock: false, declarations`
73+
- [`a11y/content-property-no-static-value`](https://github.com/YozhikM/stylelint-a11y#readme)
74+
- [`a11y/no-obsolete-attribute`](https://github.com/YozhikM/stylelint-a11y#readme)
75+
- [`a11y/no-obsolete-element`](https://github.com/YozhikM/stylelint-a11y#readme)
76+
- [`a11y/no-text-align-justify`](https://github.com/YozhikM/stylelint-a11y#readme)
77+
- [`a11y/no-outline-none`](https://github.com/YozhikM/stylelint-a11y#readme)
7278

7379
#### Rules of `stylelint-config-standard`
7480

config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// See https://stylelint.io/user-guide/rules/.
44
module.exports = {
55
extends: ['stylelint-config-standard', 'stylelint-config-prettier'],
6-
plugins: ['stylelint-scss', 'stylelint-order'],
6+
plugins: ['stylelint-scss', 'stylelint-order', 'stylelint-a11y'],
77
rules: {
88
'color-named': 'never',
99
'number-leading-zero': 'always',
@@ -38,5 +38,10 @@ module.exports = {
3838
{ type: 'at-rule', hasBlock: false },
3939
'declarations',
4040
],
41+
'a11y/content-property-no-static-value': true,
42+
'a11y/no-obsolete-attribute': true,
43+
'a11y/no-obsolete-element': true,
44+
'a11y/no-text-align-justify': true,
45+
'a11y/no-outline-none': true,
4146
},
4247
};

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"stylelint-find-new-rules": "1.0.2"
3434
},
3535
"dependencies": {
36+
"stylelint-a11y": "^1.2.1",
3637
"stylelint-config-prettier": "^5.2.0",
3738
"stylelint-config-standard": "^18.3.0",
3839
"stylelint-order": "^3.1.1",

src/__snapshots__/semver.test.js.snap

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
exports[`semver - should those tests break, consider releasing a new major version of the package config contents 1`] = `
44
Object {
5+
"a11y/content-property-no-static-value": Array [
6+
true,
7+
],
8+
"a11y/no-obsolete-attribute": Array [
9+
true,
10+
],
11+
"a11y/no-obsolete-element": Array [
12+
true,
13+
],
14+
"a11y/no-outline-none": Array [
15+
true,
16+
],
17+
"a11y/no-text-align-justify": Array [
18+
true,
19+
],
520
"at-rule-empty-line-before": null,
621
"at-rule-name-case": null,
722
"at-rule-name-newline-after": null,

src/semver.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ describe('semver - should those tests break, consider releasing a new major vers
77
it('dependencies', () => {
88
expect(pkg.dependencies).toMatchInlineSnapshot(`
99
Object {
10+
"stylelint-a11y": "^1.2.1",
1011
"stylelint-config-prettier": "^5.2.0",
1112
"stylelint-config-standard": "^18.3.0",
1213
"stylelint-order": "^3.1.1",

src/unused.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ const tooOpinionated = [
6262
'scss/dollar-variable-default',
6363
'scss/no-dollar-variables',
6464
'order/properties-alphabetical-order',
65+
'a11y/font-size-is-readable',
66+
'a11y/line-height-is-vertical-rhythmed',
67+
'a11y/media-prefers-color-scheme',
68+
'a11y/media-prefers-reduced-motion',
69+
'a11y/no-display-none',
70+
'a11y/no-spread-text',
71+
'a11y/selector-pseudo-class-focus',
6572
];
6673

6774
const overridenByOtherRule = [

0 commit comments

Comments
 (0)