eslint-plugin-document-write

1.0.1 • Public • Published

eslint-plugin-document-write

ESLint plugin to disallow document.write() and document.writeln().

Install

$ npm install --save-dev eslint eslint-plugin-document-write

or

$ yarn add --dev eslint eslint-plugin-document-write

Usage

Like other ESLint plugins,

  • add document-write/no-document-write in the rules.
  • add "document-write" in the plugins.
{
  // ...
  "rules": {
    "document-write/no-document-write": "error"
  },
  "plugins": [ "document-write" ]
}

Why

There are a lot of limitation in document.write() and document.writeln() in recent browsers. For example, you cannot use document.write() and document.writeln()in deferred (<script defer ...>) and asynchronous (<script async ...>) scripts. See MDN for other limitations.

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i eslint-plugin-document-write

Weekly Downloads

12

Version

1.0.1

License

MIT

Unpacked Size

5.44 kB

Total Files

7

Last publish

Collaborators

  • phanect