Add eslintrc
Signed-off-by: Julius Härtl <jus@bitgrid.net> Make run-eslint.sh executable Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
committed by
Julius Härtl
parent
f8f755f31e
commit
47b51c512d
6
.eslintignore
Normal file
6
.eslintignore
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
/js/tests/*
|
||||||
|
/js/vendor/*
|
||||||
|
/js/node_modules/*
|
||||||
|
/karma.conf.js
|
||||||
|
/tests/*
|
||||||
|
/l10n/*
|
||||||
34
.eslintrc.yml
Normal file
34
.eslintrc.yml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
root: true
|
||||||
|
|
||||||
|
|
||||||
|
extends:
|
||||||
|
- eslint:recommended
|
||||||
|
|
||||||
|
env:
|
||||||
|
browser: true
|
||||||
|
amd: true
|
||||||
|
|
||||||
|
globals:
|
||||||
|
app: false
|
||||||
|
angular: false
|
||||||
|
$: false
|
||||||
|
escapeHTML: false
|
||||||
|
OC: false
|
||||||
|
OCA: false
|
||||||
|
t: false
|
||||||
|
oc_current_user: false
|
||||||
|
oc_requesttoken: false
|
||||||
|
Clipboard: false
|
||||||
|
oc_defaults: false
|
||||||
|
|
||||||
|
rules:
|
||||||
|
curly: error
|
||||||
|
eqeqeq: ["error", "smart"]
|
||||||
|
guard-for-in: error
|
||||||
|
no-console: off
|
||||||
|
no-fallthrough: error
|
||||||
|
no-mixed-spaces-and-tabs: error
|
||||||
|
no-unused-vars: warn
|
||||||
|
no-use-before-define: error
|
||||||
|
semi: ["error", "always"]
|
||||||
|
indent: ["error", "tab"]
|
||||||
@@ -20,6 +20,9 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* global angular */
|
||||||
|
|
||||||
|
|
||||||
angular.module('markdown', [])
|
angular.module('markdown', [])
|
||||||
.provider('markdown', [function () {
|
.provider('markdown', [function () {
|
||||||
var opts = {};
|
var opts = {};
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** global: oc_requesttoken, markdownitLinkTarget */
|
/* global app oc_requesttoken markdownitLinkTarget */
|
||||||
|
|
||||||
app.config(function ($provide, $routeProvider, $interpolateProvider, $httpProvider, $urlRouterProvider, $stateProvider, $compileProvider, markdownItConverterProvider) {
|
app.config(function ($provide, $routeProvider, $interpolateProvider, $httpProvider, $urlRouterProvider, $stateProvider, $compileProvider, markdownItConverterProvider) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|||||||
6
run-eslint.sh
Normal file → Executable file
6
run-eslint.sh
Normal file → Executable file
@@ -8,4 +8,8 @@ if [ -z "$ESLINT" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo Checking scripts with $ESLINT ...
|
echo Checking scripts with $ESLINT ...
|
||||||
find -name "*.js" -print0 | xargs -0 $ESLINT
|
find -name "*.js" -not -path '*js/node_modules*' \
|
||||||
|
-not -path '*l10n/*' \
|
||||||
|
-not -path '*js/vendor*' \
|
||||||
|
-not -path '*js/tests*' \
|
||||||
|
-print0 | xargs -0 $ESLINT --quiet
|
||||||
|
|||||||
Reference in New Issue
Block a user