Skip to content

Commit

Permalink
Merge pull request #1 from dsb-norge/v1-x
Browse files Browse the repository at this point in the history
Initial vue3 config
  • Loading branch information
chrisnruud authored May 8, 2022
2 parents 318b54c + 4245f26 commit 82dfaa1
Show file tree
Hide file tree
Showing 5 changed files with 612 additions and 1,300 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @dsb-norge/dsb-developers
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# eslint-config-dsb-vue
# eslint-config-dsb-vue3

[![npm version](https://badge.fury.io/js/%40dsb-norge%2Feslint-config-dsb-vue.svg)](https://badge.fury.io/js/%40dsb-norge%2Feslint-config-dsb-vue)
[![GitHub license](https://img.shields.io/npm/l/@dsb-norge/eslint-config-dsb-vue)](https://github.com/dsb-norge/eslint-config-dsb-vue/blob/master/LICENSE.md)
[![npm version](https://badge.fury.io/js/%40dsb-norge%2Feslint-config-dsb-vue3.svg)](https://badge.fury.io/js/%40dsb-norge%2Feslint-config-dsb-vue3)
[![GitHub license](https://img.shields.io/npm/l/@dsb-norge/eslint-config-dsb-vue3)](https://github.com/dsb-norge/eslint-config-dsb-vue3/blob/master/LICENSE.md)

## Installation

The default export contains the [recommended ruleset for Vue](https://eslint.vuejs.org/), and the ones listed in the [rules section](https://github.com/dsb-norge/eslint-config-dsb-vue/blob/master/index.js) .
The default export contains all default [ESLint rules](https://github.com/standard/eslint-config-standard) for [JavaScript Standard Style](http://standardjs.com/) , including
the [recommended ruleset for Vue](https://eslint.vuejs.org/), and the ones listed in the [rules section](https://github.com/dsb-norge/eslint-config-dsb-vue3/blob/master/index.js) .

Note: It requires some peerDependencies as well.

Install the package with:

```sh
npx install-peerdeps --dev @dsb-norge/eslint-config-dsb-vue
npx install-peerdeps --dev @dsb-norge/eslint-config-dsb-vue3
```

Then install the correct versions of each peerDependency package, which are
listed by the command:

```sh
npm info "@dsb-norge/eslint-config-dsb-vue@latest" peerDependencies
npm info "@dsb-norge/eslint-config-dsb-vue3@latest" peerDependencies
```

## Usage
Expand All @@ -29,7 +30,7 @@ Now add the config to either your `package.json`:
```json
{
"eslintConfig": {
"extends": "@dsb-norge/dsb-vue"
"extends": "@dsb-norge/dsb-vue3"
}
}
```
Expand All @@ -38,24 +39,25 @@ or to your `.eslintrc`:

```json
{
"extends": "@dsb-norge/dsb-vue"
"extends": "@dsb-norge/dsb-vue3"
}
```

or to your `.eslintrc.js`:

```js
module.exports = {
extends: '@dsb-norge/dsb-vue'
extends: '@dsb-norge/dsb-vue3'
}
```

## Assumptions

This ESLint configuration comes with some fundamental assumptions:

- vue.js 3, vite, typescript and/or node environment
- vue.js 3 and/or node environment
- browser and/or node environment
- vite

Despite some assumptions, [you can easily overwrite, extend and unset
rules and any other setting in your custom eslint config](https://eslint.org/docs/user-guide/configuring).
10 changes: 6 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ module.exports = {
extends: [
'eslint:recommended',
'plugin:vue/vue3-recommended',
'@vue/typescript/recommended'
'standard'
],
plugins: [
'vue'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? ['error', { allow: ['error'] }] : 'warn',
Expand All @@ -31,9 +30,12 @@ module.exports = {
'vue/space-infix-ops': 'error',
'vue/space-unary-ops': 'error',
'vue/v-on-function-call': 'error',
'vue/no-empty-component-block': 'error'
'vue/no-empty-component-block': 'error',
'vue/multi-word-component-names': 'off'
},
parserOptions: {
sourceType: 'module'
requireConfigFile: false,
sourceType: 'module',
ecmaVersion: 2021
}
}
Loading

0 comments on commit 82dfaa1

Please sign in to comment.