Files
twenty/packages/twenty-front/.oxlintrc.json
T
neo773 323e66433e lint: migrate prettier to oxfmt (#20783)
Most changes are `implements` being unwrapped this is not a oxfmt
regression
Prettier in 3.7 (we're on 3.1) changed this behaviour prettier blog
[post](https://prettier.io/blog/2025/11/27/3.7.0#change-18094)

This unifies our linting tooling

---------

Co-authored-by: github-actions <github-actions@twenty.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
2026-05-22 00:21:33 +02:00

150 lines
4.2 KiB
JSON

{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["react", "typescript", "unicorn", "import"],
"jsPlugins": ["../twenty-oxlint-rules/dist/oxlint-plugin.mjs"],
"categories": {
"correctness": "off"
},
"ignorePatterns": [
"node_modules",
"src/generated",
"src/generated-metadata",
"src/generated-admin",
"src/locales/generated",
"src/testing/mock-data",
"**/__mocks__/**",
"**/*.stories.ts",
"**/*.stories.tsx",
"build",
"coverage",
"storybook-static"
],
"rules": {
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
"no-console": [
"warn",
{ "allow": ["group", "groupCollapsed", "groupEnd"] }
],
"no-script-url": "error",
"no-control-regex": "off",
"no-debugger": "error",
"no-duplicate-imports": "error",
"no-undef": "off",
"no-unused-vars": "off",
"no-redeclare": "off",
"no-restricted-imports": [
"error",
{
"patterns": [
{
"group": ["../*"],
"message": "Relative parent imports are not allowed. Use @/ alias instead."
},
{
"group": ["@tabler/icons-react"],
"message": "Please import icons from `twenty-ui`"
},
{
"group": ["react-hotkeys-web-hook"],
"importNames": ["useHotkeys"],
"message": "Please use the custom wrapper: `useScopedHotkeys` from `twenty-ui`"
},
{
"group": ["lodash"],
"message": "Please use the standalone lodash package (for instance: `import groupBy from 'lodash.groupby'` instead of `import { groupBy } from 'lodash'`)"
}
]
}
],
"import/no-duplicates": "error",
"react/no-unescaped-entities": "off",
"react/prop-types": "off",
"react/jsx-key": "off",
"react/display-name": "off",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
"react/jsx-no-useless-fragment": "off",
"react/jsx-no-script-url": "error",
"react/jsx-props-no-spreading": ["error", { "explicitSpread": "ignore" }],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
"typescript/no-redeclare": "error",
"typescript/ban-ts-comment": "error",
"typescript/consistent-type-imports": [
"error",
{
"prefer": "type-imports",
"fixStyle": "inline-type-imports"
}
],
"typescript/explicit-function-return-type": "off",
"typescript/explicit-module-boundary-types": "off",
"typescript/no-empty-object-type": [
"error",
{
"allowInterfaces": "with-single-extends"
}
],
"typescript/no-empty-function": "off",
"typescript/no-explicit-any": "off",
"typescript/no-unused-vars": [
"warn",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_"
}
],
"typescript/strict-boolean-expressions": [
"error",
{
"allowNullableBoolean": true,
"allowNullableObject": true,
"allowString": true,
"allowNumber": true,
"allowNullableString": true,
"allowNullableNumber": true,
"allowNullableEnum": true,
"allowAny": true
}
],
"twenty/effect-components": "error",
"twenty/no-hardcoded-colors": "error",
"twenty/matching-state-variable": "error",
"twenty/sort-css-properties-alphabetically": "error",
"twenty/styled-components-prefixed-with-styled": "error",
"twenty/no-state-useref": "error",
"twenty/component-props-naming": "error",
"twenty/no-navigate-prefer-link": "error",
"twenty/no-jotai-store-in-selector": "error",
"twenty/no-direct-atom-family-in-selector": "error",
"twenty/folder-structure": "error",
"twenty/enforce-module-boundaries": [
"error",
{
"depConstraints": [
{
"sourceTag": "scope:frontend",
"onlyDependOnLibsWithTags": ["scope:shared", "scope:frontend"]
}
]
}
]
},
"overrides": [
{
"files": ["**/constants/*.ts", "**/*.constants.ts"],
"rules": {
"twenty/max-consts-per-file": ["error", { "max": 1 }]
}
}
]
}