mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 11:15:24 +03:00
fix lints
This commit is contained in:
parent
8dcdae902a
commit
424c7123b8
@ -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) {
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user