eslint config rules for Particle Javascript projects
npm install -D eslint eslint-config-particle
// eslint.config.mjs
import { particle } from 'eslint-config-particle';
export default particle({
rootDir: import.meta.dirname,
testGlobals: 'mocha'
});
// eslint.config.mjs
import { particle } from 'eslint-config-particle';
export default particle({
rootDir: import.meta.dirname,
testGlobals: 'vitest',
globalIgnores: ['./update-changelog.js', './esbuild.js', '**/scripts/**'],
typescript: {
tsconfig: './tsconfig-check.json'
},
overrides: {
// When we switch to a real logger, we can turn this off
'no-console': 'off',
// Dbus APIs are usually cap functions
'new-cap': 'off'
}
});
// eslint.config.mjs
import { particle } from 'eslint-config-particle';
export default [
...particle({
rootDir: import.meta.dirname,
// more particle opts
}),
{
// my custom rules here that the particle fn doesn't let me customize
}
];
"scripts": {
"lint": "eslint",
"lint:fix": "eslint --fix",
}