This is a package containing the unified global eslint config used by all nextcloud apps and libraries. It contains the necessary dependencies and peerDependencies so that other apps cannot update if this config does not support it. Please always use dependabot to update your apps, OR pay attention to the peer dependencies error messages!
npm install @nextcloud/eslint-config --save-dev
Note
Since version 9 this package depends on ESLint 9, which uses the new flat config system.
This package provides some predefined configurations you can choose from.
For the recommended setup add a file eslint.config.js
in the root directory of your app repository with the following content:
import { recommended } from './dist/index.mjs'
export default [
...recommended,
]
Instead of the recommended
configuration this package also provides some alternatives, depending on your app setup you can also choose:
recommended
- General rules including code style
- Support for Typescript
- Support for Vue 3
- Support Vue files with Typescript syntax (the script within
.vue
files will be handled as Typescript).
recommendedJavascript
- Same as
recommended
but Vue files (the script part) will be handled as Javascript.
- Same as
recommendedVue2
- Same as
recommended
but Vue files are considered in Vue 2 syntax.
- Same as
recommendedVue2Javascript
- Same as
recommended
but Vue files are considered in Vue 2 syntax and the script part will be handled as Javascript instead of Typescript.
- Same as
- Update CHANGELOG.md file with the latest changes
- Bump the package version with
npm version
- Push version bump commit
- Create a new release with proper changelog https://github.com/nextcloud-libraries/eslint-config/releases/new