lint-no-global-mutations
v0.3.8
Published
No Global Mutation Linter
Readme
lint-no-global-mutations
Playground
A CodeMirror linter to warn against mutation of a given global object schema.
Example usage:
import { basicSetup, EditorView } from "codemirror";
import { javascript } from "@codemirror/lang-javascript";
import { NoGlobalMutations } from "lint-no-global-mutations";
const schema = { window: { isDev: false } };
const noMutation = new NoGlobalMutations(schema);
const editor = new EditorView({
extensions: [
basicSetup,
javascript(),
noMutation.linter,
],
});This will cause the following lint error:
if (window.isDev = true) {
~~~~~~~~~~~~~~~~~~~
console.debug('development mode')
}