Skip to content

Commit 25c29a0

Browse files
authored
Merge pull request #121 from github/update-dependencies
Update dependencies
2 parents 40e8afb + 4154549 commit 25c29a0

File tree

9 files changed

+1984
-2287
lines changed

9 files changed

+1984
-2287
lines changed

lib/formatters/stylish-fixes.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ try {
1212
}
1313
const getRuleURI = require('eslint-rule-documentation')
1414

15-
module.exports = function(results) {
15+
module.exports = function (results) {
1616
let output = '\n'
1717
let errors = 0
1818
let warnings = 0
@@ -82,8 +82,5 @@ function diff(a, b) {
8282
fs.writeFileSync(aPath, a, {encoding: 'utf8'})
8383
fs.writeFileSync(bPath, b, {encoding: 'utf8'})
8484
const result = childProcess.spawnSync('diff', ['-U5', aPath, bPath], {encoding: 'utf8'})
85-
return result.stdout
86-
.split('\n')
87-
.slice(2)
88-
.join('\n')
85+
return result.stdout.split('\n').slice(2).join('\n')
8986
}

lib/rules/get-attribute.js

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,30 @@ function isValidAttribute(name) {
1717
return validSVGAttributeSet.has(name) || (validAttributeName.test(name) && !invalidSVGAttributeSet.has(name))
1818
}
1919

20-
module.exports = function(context) {
21-
return {
22-
CallExpression(node) {
23-
if (!node.callee.property) return
24-
25-
const calleeName = node.callee.property.name
26-
if (!attributeCalls.test(calleeName)) return
27-
28-
const attributeNameNode = node.arguments[0]
29-
if (!attributeNameNode) return
30-
31-
if (!isValidAttribute(attributeNameNode.value)) {
32-
context.report({
33-
meta: {
34-
fixable: 'code'
35-
},
36-
node: attributeNameNode,
37-
message: 'Attributes should be lowercase and hyphen separated, or part of the SVG whitelist.',
38-
fix(fixer) {
39-
return fixer.replaceText(attributeNameNode, `'${attributeNameNode.value.toLowerCase()}'`)
40-
}
41-
})
20+
module.exports = {
21+
meta: {
22+
fixable: 'code'
23+
},
24+
create(context) {
25+
return {
26+
CallExpression(node) {
27+
if (!node.callee.property) return
28+
29+
const calleeName = node.callee.property.name
30+
if (!attributeCalls.test(calleeName)) return
31+
32+
const attributeNameNode = node.arguments[0]
33+
if (!attributeNameNode) return
34+
35+
if (!isValidAttribute(attributeNameNode.value)) {
36+
context.report({
37+
node: attributeNameNode,
38+
message: 'Attributes should be lowercase and hyphen separated, or part of the SVG whitelist.',
39+
fix(fixer) {
40+
return fixer.replaceText(attributeNameNode, `'${attributeNameNode.value.toLowerCase()}'`)
41+
}
42+
})
43+
}
4244
}
4345
}
4446
}

lib/rules/no-blur.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = function(context) {
1+
module.exports = function (context) {
22
return {
33
CallExpression(node) {
44
if (node.callee.property && node.callee.property.name === 'blur') {

lib/rules/no-useless-passive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = {
1010

1111
create(context) {
1212
return {
13-
['CallExpression[callee.property.name="addEventListener"]']: function(node) {
13+
['CallExpression[callee.property.name="addEventListener"]']: function (node) {
1414
const [name, listener, options] = node.arguments
1515
if (name.type !== 'Literal') return
1616
if (passiveEventListenerNames.has(name.value)) return

lib/rules/prefer-observers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = {
1010

1111
create(context) {
1212
return {
13-
['CallExpression[callee.property.name="addEventListener"]']: function(node) {
13+
['CallExpression[callee.property.name="addEventListener"]']: function (node) {
1414
const [name] = node.arguments
1515
if (name.type !== 'Literal') return
1616
if (!(name.value in observerMap)) return

lib/rules/require-passive-events.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = {
99

1010
create(context) {
1111
return {
12-
['CallExpression[callee.property.name="addEventListener"]']: function(node) {
12+
['CallExpression[callee.property.name="addEventListener"]']: function (node) {
1313
const [name, listener, options] = node.arguments
1414
if (!listener) return
1515
if (name.type !== 'Literal') return

lib/rules/unescaped-html-literal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = function(context) {
1+
module.exports = function (context) {
22
const htmlOpenTag = /^<[a-zA-Z]/
33
const message = 'Unescaped HTML literal. Use html`` tag template literal for secure escaping.'
44

0 commit comments

Comments
 (0)