Skip to content

Commit 5bc1559

Browse files
feat: adds first custom rule and basic config overwrite pattern
2 parents 21f9bad + f582383 commit 5bc1559

6 files changed

Lines changed: 3799 additions & 308 deletions

File tree

accessibility-rules.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

index.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const _ = require('lodash')
2+
3+
const noDefaultAltText = require('./no-default-alt-text')
4+
5+
const customRules = [noDefaultAltText]
6+
7+
const base = {
8+
config: {},
9+
customRules
10+
}
11+
12+
customRules.forEach(rule => {
13+
base.config[rule.names[1]] = true
14+
})
15+
16+
module.exports.overwriteWith = function overwriteWith(consumerConfig) {
17+
// defaults are right-most
18+
return _.defaultsDeep(consumerConfig, base)
19+
}
20+
21+
22+
module.exports = [...customRules]

0 commit comments

Comments
 (0)