This repository has been archived by the owner on Mar 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
115: ES6 support, ESLint, Babel 7 Upgrade and Babel Polyfill #322
Open
evanmwillhite
wants to merge
11
commits into
develop
Choose a base branch
from
115-eslint
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
782e830
accordion item, menu js update
6e33237
tabs compliant
52798f7
eslint-ignore
6686e1f
more ignored dirs, gulpfile fixes
a3d3972
annotations file update
d296240
babel config files, polyfill, eslint tweaks, component changes to sui…
f41a225
changed back to correct emulsify gulp package
f0371d0
115: turned off babel debugging
696b96d
115: commenting eslintignore
0f3286c
115: incorrect eslint ignores
0d671cd
115: merge conflict
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
> 0.5% | ||
not dead | ||
ie 11 | ||
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Artifacts | ||
build/**/* | ||
dist/**/* | ||
pattern-lab/**/* | ||
|
||
# 3rd party scripts | ||
components/_annotations/annotations.js | ||
components/js/babel-polyfill.js | ||
components/js/fitvids.js | ||
components/js/init.js | ||
components/js/jquery*.js | ||
components/js/modernizr.js | ||
components/js/svgxuse.min.js |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
extends: airbnb-base | ||
rules: | ||
global-require: off | ||
comma-dangle: 0 | ||
env: | ||
browser: true | ||
globals: | ||
Drupal: true |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = (api) => { | ||
api.cache(true); | ||
|
||
const presets = [ | ||
[ | ||
'@babel/preset-env', { | ||
useBuiltIns: 'entry' | ||
}, | ||
], | ||
'minify', | ||
]; | ||
|
||
return { presets }; | ||
}; |
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
50 changes: 22 additions & 28 deletions
50
components/_patterns/02-molecules/accordion-item/accordion-item.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,61 @@ | ||
(function () { | ||
/** | ||
* @file | ||
* A JavaScript file containing the main menu functionality (small/large screen) | ||
* | ||
*/ | ||
|
||
'use strict'; | ||
// JavaScript should be made compatible with libraries other than jQuery by | ||
// wrapping it with an "anonymous closure". See: | ||
// - https://drupal.org/node/1446420 | ||
// - http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth | ||
|
||
var el = document.querySelectorAll('.tabs'); | ||
var tabNavigationLinks = document.querySelectorAll('.tabs__link'); | ||
var tabContentContainers = document.querySelectorAll('.tabs__tab'); | ||
var activeIndex = 0; | ||
|
||
/** | ||
* handleClick | ||
* @description Handles click event listeners on each of the links in the | ||
* tab navigation. Returns nothing. | ||
* @param {HTMLElement} link The link to listen for events on | ||
* @param {Number} index The index of that link | ||
*/ | ||
var handleClick = function (link, index) { | ||
link.addEventListener('click', function (e) { | ||
e.preventDefault(); | ||
goToTab(index); | ||
}); | ||
}; | ||
(function tabs() { | ||
const el = document.querySelectorAll('.tabs'); | ||
const tabNavigationLinks = document.querySelectorAll('.tabs__link'); | ||
const tabContentContainers = document.querySelectorAll('.tabs__tab'); | ||
let activeIndex = 0; | ||
|
||
/** | ||
* goToTab | ||
* @description Goes to a specific tab based on index. Returns nothing. | ||
* @param {Number} index The index of the tab to go to | ||
*/ | ||
var goToTab = function (index) { | ||
function goToTab(index) { | ||
if (index !== activeIndex && index >= 0 && index <= tabNavigationLinks.length) { | ||
tabNavigationLinks[activeIndex].classList.remove('is-active'); | ||
tabNavigationLinks[index].classList.add('is-active'); | ||
tabContentContainers[activeIndex].classList.remove('is-active'); | ||
tabContentContainers[index].classList.add('is-active'); | ||
activeIndex = index; | ||
} | ||
}; | ||
} | ||
|
||
/** | ||
* handleClick | ||
* @description Handles click event listeners on each of the links in the | ||
* tab navigation. Returns nothing. | ||
* @param {HTMLElement} link The link to listen for events on | ||
* @param {Number} index The index of that link | ||
*/ | ||
function handleClick(link, index) { | ||
link.addEventListener('click', (e) => { | ||
evanmwillhite marked this conversation as resolved.
Show resolved
Hide resolved
|
||
e.preventDefault(); | ||
goToTab(index); | ||
}); | ||
} | ||
|
||
/** | ||
* init | ||
* @description Initializes the component by removing the no-js class from | ||
* the component, and attaching event listeners to each of the nav items. | ||
* Returns nothing. | ||
*/ | ||
for (var e = 0; e < el.length; e++) { | ||
el[e].classList.remove('no-js'); | ||
} | ||
Array.from(el).forEach((item) => { | ||
item.classList.remove('no-js'); | ||
}); | ||
|
||
for (var i = 0; i < tabNavigationLinks.length; i++) { | ||
var link = tabNavigationLinks[i]; | ||
Array.from(tabNavigationLinks).forEach((tabNavigationLink, i) => { | ||
const link = tabNavigationLink; | ||
handleClick(link, i); | ||
} | ||
|
||
})(); | ||
}); | ||
}()); |
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
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're using browserlist, I think the emulsify-gulp gulp-css.js and gulp-config.js files needs to be updated, so you won't pass browser arguments through the cssConfig.autoPrefixerBrowsers variable anymore?
Maybe it could be augmented so the variable will accept the autoprefixer options? like {grid: autoplace}?
https://github.com/fourkitchens/emulsify-gulp/pull/108/files