Tools
ESLint
Check that a package extends a base .eslintrc.json
You might find that your project has groups of packages that require similar configuration. Use checks to create ensure they extend a common base configuration or have specific properties.
Create custom checks for your project by using the commonality-checks-recommended package.
.commonality/extends-eslint-next
import { hasJsonFile } from 'commonality-checks-recommended';
export default hasJsonFile('.eslintrc.json', {
extends: ['@eslint-config/next'],
});
.commonality/extends-eslint-react
import { hasJsonFile } from 'commonality-checks-recommended';
export default hasJsonFile('.eslintrc.json', {
extends: ['@eslint-config/react'],
});
Selectively apply them to groups of packages in your project using selectors.
.commonality/config.json
{
"checks": [
"ui": [
"extends-eslint-react"
],
"application": [
"extends-eslint-next"
]
]
}
Was this page helpful?