@dhmk/eslint-plugin-atom

0.0.1 • Public • Published

Eslint plugin for linting @dhmk/atom.

Right now, it has one rule which detects missing (). This mostly happens while checking some conditions or accessing .length property on array atom.

Some examples:

const a = atom(true);

// should be a()
if (a) console.log("true");

const b = atom([1, 2, 3]);

// should be b().length
// since functions also have .length property, typescript won't detect an error
console.log("array length: ", b.length);

Install

npm install -D @typescript-eslint/parser @dhmk/eslint-plugin-atom

Next, activate it in your .eslintrc.js file:

module.exports = {
  root: true,
  parser: "@typescript-eslint/parser",
  parserOptions: {
    tsconfigRootDir: __dirname,
    project: "tsconfig.json",
  },
  plugins: ["@dmhk/atom"],
  rules: {
    "@dhmk/atom/missing-call": "warn",
  },
};

See typescript-eslint docs for more help.

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @dhmk/eslint-plugin-atom

    Weekly Downloads

    1

    Version

    0.0.1

    License

    MIT

    Unpacked Size

    2.8 kB

    Total Files

    4

    Last publish

    Collaborators

    • dhmk083