From b2d608746d225e2fcbd1f10fe676023de41b2540 Mon Sep 17 00:00:00 2001 From: Alexander Lichter Date: Fri, 10 Aug 2018 21:46:53 +0200 Subject: [PATCH] lint: no-var (#3681) --- .eslintrc.js | 7 +++++-- examples/auth-routes/api/index.js | 2 +- examples/tailwindcss/tailwind.js | 2 +- examples/vuex-store-modules/pages/todos.vue | 2 +- examples/with-purgecss/tailwind.js | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 25c7274cf9..5d62342eb5 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -52,12 +52,15 @@ module.exports = { 'destructuring': 'any', 'ignoreReadBeforeAssign': false }], - + // No async function without await 'require-await': 2, + // Force dot notation when possible 'dot-notation': 2, - + + 'no-var': 2, + // Do not allow console.logs etc... 'no-console': 2, 'space-before-function-paren': [2, { diff --git a/examples/auth-routes/api/index.js b/examples/auth-routes/api/index.js index 7450bc9e6d..bc5383c3aa 100644 --- a/examples/auth-routes/api/index.js +++ b/examples/auth-routes/api/index.js @@ -5,7 +5,7 @@ const router = express.Router() // Transform req & res to have the same API as express // So we can use res.status() & res.json() -var app = express() +const app = express() router.use((req, res, next) => { Object.setPrototypeOf(req, app.request) Object.setPrototypeOf(res, app.response) diff --git a/examples/tailwindcss/tailwind.js b/examples/tailwindcss/tailwind.js index 040b3a7fbe..985d0465c4 100644 --- a/examples/tailwindcss/tailwind.js +++ b/examples/tailwindcss/tailwind.js @@ -41,7 +41,7 @@ View the full documentation at https://tailwindcss.com. | */ -var colors = { +const colors = { 'transparent': 'transparent', 'black': '#222b2f', diff --git a/examples/vuex-store-modules/pages/todos.vue b/examples/vuex-store-modules/pages/todos.vue index 2188f972a2..3ca87b7a0b 100644 --- a/examples/vuex-store-modules/pages/todos.vue +++ b/examples/vuex-store-modules/pages/todos.vue @@ -21,7 +21,7 @@ export default { }), methods: { addTodo(e) { - var text = e.target.value + const text = e.target.value if (text.trim()) { this.$store.commit('todos/add', { text }) } diff --git a/examples/with-purgecss/tailwind.js b/examples/with-purgecss/tailwind.js index 040b3a7fbe..985d0465c4 100644 --- a/examples/with-purgecss/tailwind.js +++ b/examples/with-purgecss/tailwind.js @@ -41,7 +41,7 @@ View the full documentation at https://tailwindcss.com. | */ -var colors = { +const colors = { 'transparent': 'transparent', 'black': '#222b2f',