fix lints

This commit is contained in:
Benjamin Gray 2019-03-04 17:39:58 +11:00
parent 8dcdae902a
commit 424c7123b8
2 changed files with 7 additions and 7 deletions

View File

@ -96,7 +96,7 @@ module.exports = class GrammarListView {
return grammar !== atom.grammars.nullGrammar && grammar.name
})
if (atom.config.get("grammar-selector.hideDuplicateTextMateGrammars")) {
if (atom.config.get('grammar-selector.hideDuplicateTextMateGrammars')) {
const oldGrammars = grammars
grammars = []
const blacklist = new Set()
@ -131,7 +131,7 @@ module.exports = class GrammarListView {
}
function isTreeSitter (grammar) {
return grammar.constructor.name === "TreeSitterGrammar"
return grammar.constructor.name === 'TreeSitterGrammar'
}
function compareGrammarType (a, b) {

View File

@ -36,7 +36,7 @@ describe('GrammarSelector', () => {
expect(grammarView.querySelectorAll('li')[0].textContent).toBe('Auto Detect')
expect(grammarView.textContent.includes('source.a')).toBe(false)
grammarView.querySelectorAll('li').forEach(li => expect(li.textContent).not.toBe(atom.grammars.nullGrammar.name))
expect(grammarView.textContent.includes("Tree-sitter")).toBe(true) // check we are showing and labelling Tree-sitter grammars
expect(grammarView.textContent.includes('Tree-sitter')).toBe(true) // check we are showing and labelling Tree-sitter grammars
})
)
@ -185,8 +185,8 @@ describe('GrammarSelector', () => {
// check the seen JS is actually the Tree-sitter one
const list = atom.workspace.getModalPanels()[0].item
for (const item of list.items) {
if (item.name === "JavaScript") {
expect(item.constructor.name === "TreeSitterGrammar")
if (item.name === 'JavaScript') {
expect(item.constructor.name === 'TreeSitterGrammar')
}
}
})
@ -197,7 +197,7 @@ describe('GrammarSelector', () => {
let jsCount = 0
grammarView.element.querySelectorAll('li').forEach(li => {
const name = li.getAttribute('data-grammar')
if (name === "JavaScript") jsCount++
if (name === 'JavaScript') jsCount++
})
expect(jsCount).toBe(2)
})
@ -209,7 +209,7 @@ describe('GrammarSelector', () => {
const elements = grammarView.element.querySelectorAll('li')
const listItems = atom.workspace.getModalPanels()[0].item.items
for (let i = 0; i < listItems.length; i++) {
if (listItems[i].constructor.name === "TreeSitterGrammar") {
if (listItems[i].constructor.name === 'TreeSitterGrammar') {
expect(elements[i].childNodes[1].childNodes[0].className.startsWith('grammar-selector-parser')).toBe(true)
}
}