5.0.0-beta.2 • Published 3 years ago
eslint-config-sharo-scripts v5.0.0-beta.2
eslint-config-sharo-scripts
This is the ESLint shareable configuration for sharo Next.js boilerplate.
Installation
npm i eslint-config-sharo-scripts --save-dev
Usage
Add into ESLint configuration (e.g. .eslintrc.json
):
{
"extends": "sharo-scripts"
}
What is included
- JavaScript support with the recommended
eslint
rules - TypeScript support with the recommended
@typescript-eslint
rules - Prettier support via
eslint-plugin-prettier
- Jest support via
eslint-plugin-jest
withrecommended
andstyle
rules - Cypress support via
eslint-plugin-cypress
andeslint-plugin-chai-friendly
- Lint some accessibility issues in JSX via
jsx-a11y
Notes
- Cypress tests should be written in JS
- Jest tests should be written in TS
Regarding jsx-a11y/anchor-is-valid
Due to how Next.js Link component API works, jsx-a11y/anchor-is-valid
will
report this as an error:
// error because <a> does not have href
<Link href="/somewhere">
<a>Link to somewhere</a>
</Link>
To work around this issue, the rule is overriden as described in this issue:
{
'jsx-a11y/anchor-is-valid': [
'error',
{
components: ['Link'],
specialLink: ['hrefLeft', 'hrefRight'],
aspects: ['invalidHref', 'preferButton']
}
]
}
However, this workaround introduces another issue: it disables the rule's check for an href attribute altogether:
<p>
This paragraph contains <a>an anchor without href</a>.
</p>
You should probably add another accessibility checker to capture these issues, such as react-axe.
License
Licensed under MIT License.
5.0.0-beta.2
3 years ago
5.0.0-beta.1
3 years ago
4.0.0
3 years ago
3.0.0-beta.1
3 years ago
3.0.0-beta.2
3 years ago
0.9.0
3 years ago
0.8.0
4 years ago
0.7.0
4 years ago
0.6.0
4 years ago
0.5.0
4 years ago
0.5.1
4 years ago
0.4.1
4 years ago
0.4.0-beta.1
4 years ago
0.3.0
5 years ago
0.2.1
5 years ago
0.2.0
5 years ago
0.1.1
5 years ago
0.1.0
5 years ago