update eslint config
This commit is contained in:
@@ -35,6 +35,7 @@ module.exports = {
|
|||||||
'airbnb-base',
|
'airbnb-base',
|
||||||
],
|
],
|
||||||
rules: {
|
rules: {
|
||||||
|
curly: ['error', 'all'],
|
||||||
'no-continue': 'off',
|
'no-continue': 'off',
|
||||||
'no-alert': 'off',
|
'no-alert': 'off',
|
||||||
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
||||||
|
|||||||
@@ -17,9 +17,13 @@ export class Punctuation extends LinterPlugin {
|
|||||||
|
|
||||||
scan() {
|
scan() {
|
||||||
this.doc.descendants((node, position) => {
|
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)
|
const matches = this.regex.exec(node.text)
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ function getType(value: any): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function isPlainObject(value: any): value is Record<string, any> {
|
export default function isPlainObject(value: any): value is Record<string, any> {
|
||||||
if (getType(value) !== 'Object') return false
|
if (getType(value) !== 'Object') {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
return value.constructor === Object && Object.getPrototypeOf(value) === Object.prototype
|
return value.constructor === Object && Object.getPrototypeOf(value) === Object.prototype
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user