From 0aa3bdbd6da5d27c995e8440207bd69f9cf4fef0 Mon Sep 17 00:00:00 2001 From: hachy Date: Thu, 22 Sep 2016 15:01:13 +0900 Subject: [PATCH] use es6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * nogizakaの連想配列のところはエラーになる /*eslint key-spacing: ["error", { "align": { "beforeColon": true, "afterColon": true, "on": "colon" } }]*/ という設定をしても3スペース以上あると Extra space after key と注意される。日本語がだめっぽい。 --- myscript.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/myscript.js b/myscript.js index 6883a1f..c049480 100644 --- a/myscript.js +++ b/myscript.js @@ -1,7 +1,7 @@ +/* eslint-env jquery */ /* eslint quote-props: [2, "consistent"] */ -'use strict'; -var nogizaka = { +const nogizaka = { '秋元真夏' : 'https://7gogo.jp/akimoto-manatsu', '生田絵梨花' : 'https://7gogo.jp/ikuta-erika', '伊藤かりん' : 'https://7gogo.jp/itou-karin', @@ -27,20 +27,20 @@ var nogizaka = { '松村沙友理' : 'https://7gogo.jp/matsumura-sayuri', '山崎怜奈' : 'https://7gogo.jp/yamazaki-rena', '渡辺みり愛' : 'https://7gogo.jp/watanabe-miria', - '和田まあや' : 'https://7gogo.jp/wada-maaya' + '和田まあや' : 'https://7gogo.jp/wada-maaya', }; -$(function() { - var nav = $('

乃木坂46

'); - var main = $('body').children(); +$(() => { + const nav = $('

乃木坂46

'); + const main = $('body').children(); main.css('margin-left', '100px'); $('.l-header').css('margin-left', '100px'); $('body').append(nav); - $.each(nogizaka, function(name, url) { + $.each(nogizaka, (name, url) => { $('
  • ') - .append('' + name + '') + .append(`${name}`) .appendTo('.nogi-list'); }); });