Skip to content

Commit

Permalink
Merge pull request #434 from nextcloud/feat/enforce-linter
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv committed Jan 10, 2023
2 parents e6e1a39 + 77766a7 commit 35ce7b3
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 4 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/lint.yml
@@ -0,0 +1,49 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization

name: Lint

on:
pull_request:
push:
branches:
- main
- master
- stable*

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

name: lint
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@v2
id: versions
with:
fallbackNode: '^16'
fallbackNpm: '^8'

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}

- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"

- name: Install dependencies
run: |
npm ci
- name: Lint
run: |
npm run lint
2 changes: 1 addition & 1 deletion README.md
@@ -1,7 +1,7 @@
## @nextcloud/eslint-config

[![npm last version](https://img.shields.io/npm/v/@nextcloud/eslint-config.svg?style=flat-square)](https://www.npmjs.com/package/@nextcloud/eslint-config)
[![travis build status](https://img.shields.io/travis/com/nextcloud/eslint-config/master.svg?style=flat-square)](https://travis-ci.com/nextcloud/eslint-config)
[![Lint status](https://img.shields.io/github/actions/workflow/status/nextcloud/eslint-config/lint.yml?label=lint&style=flat-square)](https://github.com/nextcloud/eslint-config/actions/workflows/lint.yml)
[![Dependabot status](https://img.shields.io/badge/Dependabot-enabled-brightgreen.svg?longCache=true&style=flat-square&logo=dependabot)](https://dependabot.com)


Expand Down
7 changes: 4 additions & 3 deletions index.js
Expand Up @@ -11,6 +11,7 @@ module.exports = {
parserOptions: {
parser: '@babel/eslint-parser',
ecmaVersion: 6,
requireConfigFile: false,
},
extends: [
'eslint:recommended',
Expand Down Expand Up @@ -91,8 +92,8 @@ module.exports = {
multiline: 1,
}],
'vue/first-attribute-linebreak': ['error', {
'singleline': 'beside',
'multiline': 'beside',
singleline: 'beside',
multiline: 'beside',
}],
// Allow single-word components names
'vue/multi-word-component-names': ['off'],
Expand All @@ -106,7 +107,7 @@ module.exports = {
// Allow shallow import of @vue/test-utils and @testing-library/vue in order to be able to use it in
// the src folder
'n/no-unpublished-import': ['error', {
'allowModules': ['@vue/test-utils', '@testing-library/vue'],
allowModules: ['@vue/test-utils', '@testing-library/vue'],
}],
// require object literal shorthand syntax
'object-shorthand': ['error', 'always'],
Expand Down
4 changes: 4 additions & 0 deletions package.json
Expand Up @@ -7,6 +7,10 @@
"type": "git",
"url": "git+https://github.com/nextcloud/eslint-config.git"
},
"scripts": {
"lint": "eslint -c index.js *.js",
"lint:fix": "eslint -c index.js --fix *.js"
},
"peerDependencies": {
"@babel/core": "^7.13.10",
"@babel/eslint-parser": "^7.16.5",
Expand Down

0 comments on commit 35ce7b3

Please sign in to comment.