Skip to content

dxos/eslint-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DXOS eslint config

An eslint config for DXOS packages that extends semistandard with typescript support

Usage

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"
}

Common issues

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

Contributing

To make changes to recomended config edit packages/eslint-plugin/configs/recomended.js

Adding custom rules

  1. Create a new rule file in packages/eslint-plugin/rules. You can take inspiration from the header rule.
  2. Export the rule in packages/eslint-plugin/index.js.
  3. Use the rule with the like "dxos/<rule name>": "error" in the eslint config.

About

Linter configuration for DXOS packages

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published