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);
if (a) console.log("true");
const b = atom([1, 2, 3]);
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.