mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 09:09:36 +02:00
22 lines
671 B
JavaScript
22 lines
671 B
JavaScript
module.exports = {
|
|
meta: {
|
|
type: 'error',
|
|
docs: {
|
|
description:
|
|
'Prohibit CodeMirror themes that are generated in a function',
|
|
},
|
|
},
|
|
create(context) {
|
|
return {
|
|
':matches(ArrowFunctionExpression, FunctionDeclaration, FunctionExpression) CallExpression > MemberExpression[object.name="EditorView"]:matches([property.name="theme"],[property.name="baseTheme"])'(
|
|
node
|
|
) {
|
|
context.report({
|
|
node,
|
|
message: `EditorView.theme and EditorView.baseTheme each add CSS to the page for every instance of the theme. Store the theme in a variable and reuse it instead.`,
|
|
})
|
|
},
|
|
}
|
|
},
|
|
}
|