mirror of
https://github.com/lingble/twenty.git
synced 2025-10-29 20:02:29 +00:00
POC: chore: use Nx workspace lint rules (#3163)
* chore: use Nx workspace lint rules Closes #3162 * Fix lint * Fix lint on BE * Fix tests --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
64
tools/eslint-rules/index.ts
Normal file
64
tools/eslint-rules/index.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
import {
|
||||
rule as componentPropsNaming,
|
||||
RULE_NAME as componentPropsNamingName,
|
||||
} from './rules/component-props-naming';
|
||||
import {
|
||||
rule as effectComponents,
|
||||
RULE_NAME as effectComponentsName,
|
||||
} from './rules/effect-components';
|
||||
import {
|
||||
rule as matchingStateVariable,
|
||||
RULE_NAME as matchingStateVariableName,
|
||||
} from './rules/matching-state-variable';
|
||||
import {
|
||||
rule as noHardcodedColors,
|
||||
RULE_NAME as noHardcodedColorsName,
|
||||
} from './rules/no-hardcoded-colors';
|
||||
import {
|
||||
rule as noStateUseref,
|
||||
RULE_NAME as noStateUserefName,
|
||||
} from './rules/no-state-useref';
|
||||
import {
|
||||
rule as sortCssPropertiesAlphabetically,
|
||||
RULE_NAME as sortCssPropertiesAlphabeticallyName,
|
||||
} from './rules/sort-css-properties-alphabetically';
|
||||
import {
|
||||
rule as styledComponentsPrefixedWithStyled,
|
||||
RULE_NAME as styledComponentsPrefixedWithStyledName,
|
||||
} from './rules/styled-components-prefixed-with-styled';
|
||||
/**
|
||||
* Import your custom workspace rules at the top of this file.
|
||||
*
|
||||
* For example:
|
||||
*
|
||||
* import { RULE_NAME as myCustomRuleName, rule as myCustomRule } from './rules/my-custom-rule';
|
||||
*
|
||||
* In order to quickly get started with writing rules you can use the
|
||||
* following generator command and provide your desired rule name:
|
||||
*
|
||||
* ```sh
|
||||
* npx nx g @nx/eslint:workspace-rule {{ NEW_RULE_NAME }}
|
||||
* ```
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
/**
|
||||
* Apply the imported custom rules here.
|
||||
*
|
||||
* For example (using the example import above):
|
||||
*
|
||||
* rules: {
|
||||
* [myCustomRuleName]: myCustomRule
|
||||
* }
|
||||
*/
|
||||
rules: {
|
||||
[componentPropsNamingName]: componentPropsNaming,
|
||||
[effectComponentsName]: effectComponents,
|
||||
[matchingStateVariableName]: matchingStateVariable,
|
||||
[noHardcodedColorsName]: noHardcodedColors,
|
||||
[noStateUserefName]: noStateUseref,
|
||||
[sortCssPropertiesAlphabeticallyName]: sortCssPropertiesAlphabetically,
|
||||
[styledComponentsPrefixedWithStyledName]:
|
||||
styledComponentsPrefixedWithStyled,
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user