An eslint config for DXOS packages that extends semistandard with typescript support
Install dependencies
yarn add -D @dxos/eslint-plugin typescript
Add this to your .eslintrc.json
:
{
"extends": "plugin:@dxos/recomended"
}
Or for react projects:
yarn add -D @dxos/eslint-plugin typescript eslint-plugin-react
{
"extends": "plugin:@dxos/react"
}
Error message:
Oops! Something went wrong! :(
ESLint: 7.9.0
Error: package.json » plugin:@dxos/recomended:
Configuration for rule "import/order" is invalid:
Value {"pathGroups":[{"pattern":"@material-ui/**","group":"external","position":"after"},{"pattern":"@{dxos,wirelineio}/**","group":"internal","position":"before"}],"pathGroupsExcludedImportTypes":["@{dxos,wirelineio}/**","@material-ui/**"],"newlines-between":"always","groups":[["builtin","external"],"internal"],"alphabetize":{"order":"asc"}} should NOT have additional properties.
Workaround:
Do a clean re-install of node_modules:
git clean -fdx # at repo root
yarn
To make changes to recomended config edit packages/eslint-plugin/configs/recomended.js
- Create a new rule file in
packages/eslint-plugin/rules
. You can take inspiration from the header rule. - Export the rule in
packages/eslint-plugin/index.js
. - Use the rule with the like
"dxos/<rule name>": "error"
in the eslint config.