0.0.1 • Published 4 years ago
@dhmk/eslint-plugin-atom v0.0.1
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-atomNext, 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.
0.0.1
4 years ago