From ab29ac44906a7476788f8630c3fd9b732ebd129e Mon Sep 17 00:00:00 2001 From: Yavor Georgiev Date: Mon, 10 Jul 2017 16:53:00 +0200 Subject: [PATCH] Fix linter issues (#1132) --- .eslintignore | 1 + .eslintrc.json | 3 ++- docs/sync.js | 1 - lib/user-methods.js | 1 + scripts/handle-license-check.js | 19 +++++++++++++++++++ scripts/react-tests-android.js | 20 ++++++++++++++++++++ tests/.eslintrc.json | 3 ++- tests/js/session-tests.js | 4 +++- 8 files changed, 48 insertions(+), 4 deletions(-) diff --git a/.eslintignore b/.eslintignore index 988d8689..f2bf8590 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,6 +1,7 @@ /core*/ /docs/jsdoc-template/ /docs/output/ +/docs/plugins/ build/ node_modules/ diff --git a/.eslintrc.json b/.eslintrc.json index 49e3f61b..66795cfd 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -8,10 +8,11 @@ "rules": { "comma-dangle": 0, "no-empty": 0, + "no-console": 0, "no-unused-vars": [ "warn", { "varsIgnorePattern": "^_", - "argsIgnorePattern": "^_" + "args": "none" } ], "strict": [2, "global"] diff --git a/docs/sync.js b/docs/sync.js index 648dc3bd..2a24cd2e 100644 --- a/docs/sync.js +++ b/docs/sync.js @@ -1,4 +1,3 @@ -import {stringify} from 'ini'; //////////////////////////////////////////////////////////////////////////// // // Copyright 2016 Realm Inc. diff --git a/lib/user-methods.js b/lib/user-methods.js index 1a7e343d..34815730 100644 --- a/lib/user-methods.js +++ b/lib/user-methods.js @@ -33,6 +33,7 @@ function checkTypes(args, types) { } } +/* global fetch */ const performFetch = typeof fetch === 'undefined' ? node_require('node-fetch') : fetch; const url_parse = require('url-parse'); diff --git a/scripts/handle-license-check.js b/scripts/handle-license-check.js index bacdca73..c58cc26d 100644 --- a/scripts/handle-license-check.js +++ b/scripts/handle-license-check.js @@ -1,4 +1,23 @@ #!/usr/bin/env node +//////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Realm Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////// + +'use strict'; process.stdin.resume(); process.stdin.setEncoding('utf8'); diff --git a/scripts/react-tests-android.js b/scripts/react-tests-android.js index 3edf421b..798619d0 100644 --- a/scripts/react-tests-android.js +++ b/scripts/react-tests-android.js @@ -1,3 +1,23 @@ +//////////////////////////////////////////////////////////////////////////// +// +// Copyright 2016 Realm Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////// + +'use strict'; + var shell = require("shelljs"); shell.set("-e"); diff --git a/tests/.eslintrc.json b/tests/.eslintrc.json index 051d0da1..1d5c7eb5 100644 --- a/tests/.eslintrc.json +++ b/tests/.eslintrc.json @@ -22,6 +22,7 @@ "no-magic-numbers": "off", "jasmine/no-spec-dupes": ["error", "branch"], "jasmine/no-suite-dupes": ["error", "branch"], - "no-console": "off" + "no-console": "off", + "no-unused-vars": "off" } } diff --git a/tests/js/session-tests.js b/tests/js/session-tests.js index 9f631b1d..1e72a71b 100644 --- a/tests/js/session-tests.js +++ b/tests/js/session-tests.js @@ -20,6 +20,8 @@ 'use strict'; +/* global REALM_MODULE_PATH */ + const Realm = require('realm'); const TestCase = require('./asserts'); @@ -120,7 +122,7 @@ module.exports = { catch (e) { reject(e) } - }; + } // Let the error handler trigger our checks when the access token was refreshed. postTokenRefreshChecks._notifyOnAccessTokenRefreshed = accessTokenRefreshed;