@arnaud-barre/eslint-config v5.3.7
eslint-config 
Install
yarn add --dev eslint @arnaud-barre/eslint-config
// eslint.config.js
import baseConfig from "@arnaud-barre/eslint-config";
export default [...baseConfig];
// package.json
"scripts": {
"lint": "bun lint-ci --fix --cache",
"lint-ci": "eslint . --max-warnings 0"
}
TS config (5.5)
{
"include": ["**/*.ts", "**/*.tsx"],
"compilerOptions": {
"target": "ES2021",
"useDefineForClassFields": true,
"jsx": "react-jsx",
"module": "ESNext",
"lib": ["ES2021", "DOM", "DOM.Iterable"],
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,
/* Linting */
"skipLibCheck": true,
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"useUnknownInCatchVariables": true,
"noPropertyAccessFromIndexSignature": true
}
}
For Node projects
{
"include": ["**/*.ts"],
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"lib": ["ES2022"]
/* ... */
}
}
Adding local rules
Here is an example for an hypothetical "no-while" rule (that could simply be achieved by using the no-restricted-syntax rule)
// eslint.config.js
import baseConfig from "@arnaud-barre/eslint-config";
import tseslint from "typescript-eslint";
/**
* @type {import("@typescript-eslint/utils").TSESLint.RuleModule<"error">}
*/
const noWhileRule = {
meta: {
messages: { error: "Don't use while" },
type: "problem",
schema: [],
},
create: (context) => ({
WhileStatement(node) {
context.report({ node, messageId: "error" });
},
}),
};
export default tseslint.config(...baseConfig, {
plugins: {
local: {
rules: {
"no-while": noWhileRule,
},
},
},
rules: {
"local/no-while": "warn",
},
});
5 months ago
5 months ago
6 months ago
6 months ago
8 months ago
9 months ago
9 months ago
9 months ago
11 months ago
4 months ago
4 months ago
4 months ago
4 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago