98e74ee48d
Add linting to the mobile app and include core and api-client packages in the root lint, typecheck, and test scripts. Ignore node_modules in all subdirectories and clean up stale test results. Update lint and typecheck scripts for all packages Add ESLint configuration for mobile app and shared packages. Rename mobile jest config to .cjs and enable ESM. Include packages/core and packages/api-client in monorepo lint, typecheck, and test scripts.
85 lines
2.2 KiB
JavaScript
85 lines
2.2 KiB
JavaScript
import js from "@eslint/js";
|
|
import ts from "typescript-eslint";
|
|
import reactPlugin from "eslint-plugin-react";
|
|
|
|
// We have no .eslintrc, so we must define everything here.
|
|
|
|
export default ts.config(
|
|
{
|
|
ignores: ["dist/**"],
|
|
},
|
|
{
|
|
extends: [js.configs.recommended, ts.configs.recommended],
|
|
files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
|
|
languageOptions: {
|
|
ecmaVersion: 2022,
|
|
sourceType: "module",
|
|
globals: {
|
|
// React Native globals
|
|
__DEV__: "readonly",
|
|
alert: "readonly",
|
|
console: "readonly",
|
|
document: "readonly",
|
|
navigator: "readonly",
|
|
window: "readonly",
|
|
require: "readonly",
|
|
module: "readonly",
|
|
exports: "readonly",
|
|
process: "readonly",
|
|
jest: "readonly",
|
|
describe: "readonly",
|
|
it: "readonly",
|
|
test: "readonly",
|
|
expect: "readonly",
|
|
beforeEach: "readonly",
|
|
afterEach: "readonly",
|
|
beforeAll: "readonly",
|
|
afterAll: "readonly",
|
|
},
|
|
parserOptions: {
|
|
ecmaFeatures: {
|
|
jsx: true,
|
|
},
|
|
},
|
|
},
|
|
plugins: {
|
|
react: reactPlugin,
|
|
},
|
|
rules: {
|
|
...js.configs.recommended.rules,
|
|
...ts.configs.recommended.rules,
|
|
// TypeScript handles type-related issues
|
|
"no-undef": "off",
|
|
"@typescript-eslint/no-explicit-any": "off",
|
|
// Allow _-prefixed parameters and variables to signal intentionally unused
|
|
"no-unused-vars": [
|
|
"warn",
|
|
{
|
|
varsIgnorePattern: "^_",
|
|
argsIgnorePattern: "^_",
|
|
caughtErrorsIgnorePattern: "^_",
|
|
},
|
|
],
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"warn",
|
|
{
|
|
varsIgnorePattern: "^_",
|
|
argsIgnorePattern: "^_",
|
|
caughtErrorsIgnorePattern: "^_",
|
|
},
|
|
],
|
|
// React Native uses require() heavily
|
|
"no-var-requires": "off",
|
|
// We use React Native's StyleSheet
|
|
"react/no-unknown-property": [
|
|
"error",
|
|
{
|
|
ignore: ["flex", "justifyContent", "alignItems", "width", "height", "margin", "padding"],
|
|
},
|
|
],
|
|
// Allow console.log for debugging
|
|
"no-console": "off",
|
|
},
|
|
},
|
|
);
|