New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@miovision/eslint-plugin-disallow-date

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@miovision/eslint-plugin-disallow-date

An ESLint plugin to disallow usage of JavaScript Date objects.

2.0.0
latest
Source
npm
Version published
Weekly downloads
1.8K
-25.65%
Maintainers
3
Weekly downloads
 
Created
Source

eslint-plugin-disallow-date

Build Status

An ESLint plugin to disallow usage of JavaScript Date objects.

Installation

  • Install ESLint:

    $ npm i -D eslint
    
  • Install @miovision/eslint-plugin-disallow-date:

    $ npm i -D @miovision/eslint-plugin-disallow-date
    

Note: If you installed ESLint globally (using the -g flag) then you must also install @miovision/eslint-plugin-disallow-date globally.

Usage

Add @miovision/disallow-date to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix, but must include the @miovision package scope:

{
    "plugins": [
        "@miovision/disallow-date"
    ]
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "@miovision/disallow-date/no-new-date": 2,
        "@miovision/disallow-date/no-static-date": 2,
        "@miovision/disallow-date/no-to-date": 2,
    }
}

Run the linter with npx eslint --ext=js .

Supported Rules

Rule IDDescription
disallow-date/no-new-datedisallow new Date() usage
disallow-date/no-static-datedisallow Date.now() and other static functions
disallow-date/no-to-datedisallow moment().toDate() functions

License

The content of this project under the MIT license.

Keywords

eslint

FAQs

Package last updated on 24 Sep 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts