Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Verify that a rule has a meta property before accessing #1026

Merged
merged 1 commit into from
Sep 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ function updateFixableRules(linter) {
// Build a set of fixable rules based on the rules loaded in the provided linter
const currentRules = new Set()
linter.getRules().forEach((props, rule) => {
if (Object.prototype.hasOwnProperty.call(props.meta, 'fixable')) {
if (
Object.prototype.hasOwnProperty.call(props, 'meta') &&
Object.prototype.hasOwnProperty.call(props.meta, 'fixable')
) {
currentRules.add(rule)
}
})
Expand Down