diff --git a/.eslintrc.js b/.eslintrc.js index 0b4c7102..c2ab3bf3 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -35,6 +35,7 @@ module.exports = { 'airbnb-base', ], rules: { + curly: ['error', 'all'], 'no-continue': 'off', 'no-alert': 'off', 'no-console': ['warn', { allow: ['warn', 'error'] }], diff --git a/demos/src/Experiments/Linter/Vue/extension/plugins/Punctuation.ts b/demos/src/Experiments/Linter/Vue/extension/plugins/Punctuation.ts index befd7d63..f0b569c8 100644 --- a/demos/src/Experiments/Linter/Vue/extension/plugins/Punctuation.ts +++ b/demos/src/Experiments/Linter/Vue/extension/plugins/Punctuation.ts @@ -17,9 +17,13 @@ export class Punctuation extends LinterPlugin { scan() { this.doc.descendants((node, position) => { - if (!node.isText) return + if (!node.isText) { + return + } - if (!node.text) return + if (!node.text) { + return + } const matches = this.regex.exec(node.text) diff --git a/packages/core/src/utilities/isPlainObject.ts b/packages/core/src/utilities/isPlainObject.ts index febff25b..88931443 100644 --- a/packages/core/src/utilities/isPlainObject.ts +++ b/packages/core/src/utilities/isPlainObject.ts @@ -5,6 +5,9 @@ function getType(value: any): string { } export default function isPlainObject(value: any): value is Record { - if (getType(value) !== 'Object') return false + if (getType(value) !== 'Object') { + return false + } + return value.constructor === Object && Object.getPrototypeOf(value) === Object.prototype }