railbird-gql/.eslintrc.js

54 lines
1.7 KiB
JavaScript
Raw Normal View History

2024-01-05 14:33:31 -07:00
module.exports = {
2024-01-06 19:32:00 -07:00
settings: {
react: {
version: "detect",
2024-01-05 19:19:45 -07:00
},
2024-01-06 19:32:00 -07:00
},
env: {
browser: true,
es2021: true,
node: true,
},
extends: ["plugin:react/recommended", "prettier"],
overrides: [
{
env: {
node: true,
},
files: [".eslintrc.{js,cjs}"],
parserOptions: {
sourceType: "script",
},
2024-01-05 14:33:31 -07:00
},
2024-01-06 19:32:00 -07:00
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["@typescript-eslint", "react", "react-hooks", "react-native"],
rules: {
// Best Practices
eqeqeq: ["error", "always"], // Enforce '===' instead of '=='
curly: "error", // Require curly braces for all control statements
"no-unused-vars": "warn", // Warn about variables that are declared but not used
2024-01-05 15:24:24 -07:00
2024-01-06 19:32:00 -07:00
// React Specific
"react/jsx-filename-extension": [1, { extensions: [".tsx"] }], // Allow jsx syntax in .tsx files
"react/react-in-jsx-scope": "off", // Not necessary with React 17+
"react/prop-types": "off", // Not needed with TypeScript
2024-01-05 15:24:24 -07:00
2024-01-06 19:32:00 -07:00
// React-Native Specific
"react-native/no-unused-styles": "warn", // Warn about unused styles
"react-native/split-platform-components": "warn", // Encourage splitting of React Native components into platform-specific files
2024-01-05 15:24:24 -07:00
2024-01-06 19:32:00 -07:00
// TypeScript Specific
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }], // Warn about variables that are declared but not used
2024-01-05 15:24:24 -07:00
2024-01-06 19:32:00 -07:00
// Hooks Specific
"react-hooks/rules-of-hooks": "error", // Checks rules of Hooks
"react-hooks/exhaustive-deps": "warn", // Checks effect dependencies
},
2024-01-05 15:24:24 -07:00
};