-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #903 from nextcloud/chore/nextcloud-eslint-and-babel
chore: migrate to @nextcloud/eslint-config and @nextcloud/babel-config
- Loading branch information
Showing
41 changed files
with
4,463 additions
and
2,677 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,5 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
browser: true, | ||
es6: true, | ||
node: true | ||
}, | ||
globals: { | ||
dav: true | ||
}, | ||
extends: ['eslint:recommended', 'plugin:node/recommended', 'standard'], | ||
plugins: ['node'], | ||
rules: { | ||
// space before function () | ||
'space-before-function-paren': ['error', 'never'], | ||
// curly braces always space | ||
'object-curly-spacing': ['error', 'always'], | ||
'array-bracket-spacing': ['error', 'never'], | ||
// stay consistent with array brackets | ||
'array-bracket-newline': ['error', 'consistent'], | ||
// 1tbs brace style | ||
'brace-style': 'error', | ||
// tabs only | ||
indent: ['error', 'tab'], | ||
'no-tabs': 0, | ||
// only debug console | ||
'no-console': ['error', { allow: ['error', 'warn', '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'], | ||
// es6 import/export and require | ||
'node/no-unsupported-features/es-syntax': ['off'], | ||
// disable the recommended no-extra-semi | ||
semi: ['error', 'always'], | ||
// dot notation exclusion for uppercase first letters variables | ||
'dot-notation': ['error', { allowPattern: '^[A-Z][a-zA-Z]+$' }] | ||
} | ||
}; | ||
extends: [ | ||
'@nextcloud', | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,3 @@ | ||
module.exports = { | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
useBuiltIns: 'usage', | ||
corejs: 3 | ||
} | ||
] | ||
] | ||
} | ||
const babelConfig = require('@nextcloud/babel-config') | ||
|
||
module.exports = babelConfig |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,16 +23,16 @@ | |
|
||
/** | ||
* creates a debug function bound to a context | ||
* @param {String} context | ||
* @returns {Function} | ||
* @param {string} context | ||
Check warning on line 26 in src/debug.js
|
||
* @return {Function} | ||
*/ | ||
export function debugFactory(context) { | ||
return (...args) => { | ||
if (debugFactory.enabled) { | ||
// eslint-disable-next-line no-console | ||
console.debug(context, ...args); | ||
console.debug(context, ...args) | ||
} | ||
}; | ||
} | ||
} | ||
|
||
debugFactory.enabled = false; | ||
debugFactory.enabled = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,12 +30,12 @@ export default class AttachError extends Error { | |
|
||
/** | ||
* | ||
* @param {Object} attach | ||
* @param {object} attach | ||
Check warning on line 33 in src/errors/attachError.js
|
||
*/ | ||
constructor(attach) { | ||
super(); | ||
super() | ||
|
||
Object.assign(this, attach); | ||
Object.assign(this, attach) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.