Skip to content

Commit

Permalink
Merge pull request #235 from nextcloud/dependabot/npm_and_yarn/eslint…
Browse files Browse the repository at this point in the history
…-plugin-node-10.0.0
  • Loading branch information
dependabot-preview[bot] authored Sep 29, 2019
2 parents 2747c10 + 08bc3b7 commit 28a8088
Show file tree
Hide file tree
Showing 14 changed files with 97 additions and 141 deletions.
95 changes: 4 additions & 91 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,95 +1,8 @@
module.exports = {
root: true,
env: {
browser: true,
es6: true,
node: true,
jest: true
},
globals: {
$: true,
appVersion: true,
t: true,
n: true,
OC: true,
OCA: true,
Vue: true,
Cypress: true,
cy: true
},
parserOptions: {
parser: 'babel-eslint',
ecmaVersion: 6
appVersion: true
},
extends: [
'eslint:recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:node/recommended',
'plugin:vue/essential',
'plugin:vue/recommended',
'standard'
],
settings: {
'import/resolver': {
webpack: {
config: 'webpack.common.js'
},
node: {
paths: ['src'],
extensions: ['.js', '.vue']
}
}
},
plugins: ['vue', 'node'],
rules: {
// space before function ()
'space-before-function-paren': ['error', 'never'],
// curly braces always space
'object-curly-spacing': ['error', 'always'],
// stay consistent with array brackets
'array-bracket-newline': ['error', 'consistent'],
// 1tbs brace style
'brace-style': 'error',
// tabs only
indent: ['error', 'tab'],
'no-tabs': 0,
'vue/html-indent': ['error', 'tab'],
// only debug console
'no-console': ['error', { allow: ['error', 'warn', 'info', 'debug'] }],
// classes blocks
'padded-blocks': ['error', { classes: 'always' }],
// always have the operator in front
'operator-linebreak': ['error', 'before'],
// ternary on multiline
'multiline-ternary': ['error', 'always-multiline'],
// force proper JSDocs
'valid-jsdoc': [2, {
'prefer': {
'return': 'returns'
},
'requireReturn': false,
'requireReturnDescription': false
}],
// es6 import/export and require
'node/no-unpublished-require': ['off'],
'node/no-unsupported-features/es-syntax': ['off'],
// kebab case components for vuejs
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
// space before self-closing elements
'vue/html-closing-bracket-spacing': 'error',
// no ending html tag on a new line
'vue/html-closing-bracket-newline': ['error', { multiline: 'never' }],
// code spacing with attributes
'vue/max-attributes-per-line': [
'error',
{
singleline: 3,
multiline: {
max: 3,
allowFirstLine: true
}
}
]
}
}
'nextcloud'
]
};
2 changes: 1 addition & 1 deletion cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Cypress.Commands.add('login', (user, password, route = '/apps/files') => {
cy.visit(route)
cy.get('input[name=user]').type(user)
cy.get('input[name=password]').type(password)
cy.get('input#submit').click()
cy.get('#submit-wrapper input[type=submit]').click()
cy.url().should('include', route)
})

Expand Down
36 changes: 18 additions & 18 deletions js/viewer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer.js.map

Large diffs are not rendered by default.

51 changes: 43 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,18 @@
"@babel/preset-env": "^7.6.2",
"babel-eslint": "^10.0.3",
"babel-loader": "^8.0.6",
"browserslist-config-nextcloud": "0.0.1",
"css-loader": "^3.2.0",
"cypress": "^3.4.1",
"cypress-image-snapshot": "^3.1.1",
"eslint": "^5.16.0",
"eslint-config-nextcloud": "0.0.5",
"eslint-config-standard": "^12.0.0",
"eslint-import-resolver-webpack": "^0.11.1",
"eslint-loader": "^3.0.2",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-node": "^9.2.0",
"eslint-plugin-nextcloud": "^0.3.0",
"eslint-plugin-node": "^10.0.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-vue": "^5.2.3",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Images.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import axios from 'axios'
import Vue from 'vue'
import AsyncComputed from 'vue-async-computed'
import Mime from 'Mixins/Mime'
import Mime from '../mixins/Mime'
Vue.use(AsyncComputed)
Expand Down
4 changes: 2 additions & 2 deletions src/components/Videos.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
</template>

<script>
import Mime from 'Mixins/Mime'
import PreviewUrl from 'Mixins/PreviewUrl'
import Mime from '../mixins/Mime'
import PreviewUrl from '../mixins/PreviewUrl'
const liveExt = ['jpg', 'jpeg', 'png']
Expand Down
10 changes: 6 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@
*
*/
import Vue from 'vue'
import ViewerComponent from 'Views/Viewer'
import ViewerService from 'Services/Viewer'
import ViewerComponent from './views/Viewer'
import ViewerService from './services/Viewer'

import { generateFilePath } from 'nextcloud-server/dist/router'

Vue.prototype.$ = $

Vue.prototype.t = t
Vue.prototype.n = n

Expand Down Expand Up @@ -58,6 +56,10 @@ document.body.appendChild(ViewerRoot)
// Init vue
export default new Vue({
el: '#viewer',
// When debugging the page, it's easier to find which app
// is which. Especially when there is multiple apps
// roots mounted o the same page!
// eslint-disable-next-line vue/match-component-file-name
name: 'ViewerRoot',
render: h => h(ViewerComponent)
})
2 changes: 1 addition & 1 deletion src/models/images.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
*/

import Images from 'Components/Images'
import Images from '../components/Images'

export default {
id: 'images',
Expand Down
2 changes: 1 addition & 1 deletion src/models/videos.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
*/

import Videos from 'Components/Videos'
import Videos from '../components/Videos'

export default {
id: 'videos',
Expand Down
4 changes: 2 additions & 2 deletions src/services/Viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
*
*/

import Images from 'Models/images'
import Videos from 'Models/videos'
import Images from '../models/images'
import Videos from '../models/videos'

export default class Viewer {

Expand Down
8 changes: 4 additions & 4 deletions src/views/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ import isMobile from 'nextcloud-vue/dist/Mixins/isMobile'
import isFullscreen from 'nextcloud-vue/dist/Mixins/isFullscreen'
import { generateRemoteUrl } from 'nextcloud-server/dist/router'
import Error from 'Components/Error'
import PreviewUrl from 'Mixins/PreviewUrl'
import File from 'Models/file'
import FileList from 'Services/FileList'
import Error from '../components/Error'
import PreviewUrl from '../mixins/PreviewUrl'
import File from '../models/file'
import FileList from '../services/FileList'
import Modal from 'nextcloud-vue/dist/Components/Modal'
import ActionButton from 'nextcloud-vue/dist/Components/ActionButton'
Expand Down
15 changes: 9 additions & 6 deletions webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ const path = require('path')
const webpack = require('webpack')
const { VueLoaderPlugin } = require('vue-loader')
const StyleLintPlugin = require('stylelint-webpack-plugin')
const packageJson = require('./package.json')
const appName = packageJson.name
const appVersion = JSON.stringify(packageJson.version)

module.exports = {
entry: path.join(__dirname, 'src', 'main.js'),
output: {
path: path.resolve(__dirname, './js'),
publicPath: '/js/',
filename: 'viewer.js',
chunkFilename: 'chunks/[name].js'
filename: `${appName}.js`,
chunkFilename: 'chunks/[name]-[hash].js'
},
module: {
rules: [
Expand All @@ -24,11 +27,13 @@ module.exports = {
{
test: /\.(js|vue)$/,
use: 'eslint-loader',
exclude: /node_modules/,
enforce: 'pre'
},
{
test: /\.vue$/,
loader: 'vue-loader'
loader: 'vue-loader',
exclude: /node_modules/
},
{
test: /\.js$/,
Expand All @@ -44,9 +49,7 @@ module.exports = {
plugins: [
new VueLoaderPlugin(),
new StyleLintPlugin(),
new webpack.DefinePlugin({
appVersion: JSON.stringify(require('./package.json').version)
})
new webpack.DefinePlugin({ appVersion })
],
resolve: {
alias: {
Expand Down

0 comments on commit 28a8088

Please sign in to comment.