Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

[WIP] Linting with eslint and husky #710

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

azerella
Copy link
Contributor

@azerella azerella commented Apr 1, 2019

As drafted by @toxamiz in #700, this is a more workable branch.

Issue reference: #429

Todo:

  • JavaScript linting needs to be IE8 compliant.

@azerella azerella changed the title Starter files for eslint and husky formatting Linting with eslint and husky Apr 1, 2019
@azerella azerella added this to the Sprint 126 milestone Apr 1, 2019
@azerella azerella added this to ✏️ Sprint backlog in Design System via automation Apr 1, 2019
@azerella azerella added the enhancement New feature or request. label Apr 1, 2019
@azerella azerella changed the title Linting with eslint and husky [WIP] Linting with eslint and husky Apr 1, 2019
@sukhrajghuman sukhrajghuman moved this from ✏️ Sprint backlog to 🔬 QA in Design System Apr 1, 2019
@azerella azerella moved this from 🔬 QA to ✏️ Sprint backlog in Design System Apr 1, 2019
@toxamiz
Copy link

toxamiz commented Apr 1, 2019

@adamzerella, What you think about #700 (comment) ?

Summary easy way to make js code IE8 compliant: stick with es5 syntax and recommend users to apply polyfills if they actually need an IE8 support es-shim, DOM-shim.

Or start to use transpile or even some of bundler (rollup etc.) on module.js.

jQuery includes some polyfills as i know, so actualy don't need to do anything here (just es5 and jQuery API).

@azerella
Copy link
Contributor Author

azerella commented Apr 1, 2019

We don't have a choice when it comes to IE8 support, it's something that we support @toxamiz.

We might need to create a IE8 complaint eslint-plugin to resolve this ticket. We need to be able to write code that provides our developers with linting without relying on polyfills.

@toxamiz
Copy link

toxamiz commented Apr 2, 2019

@adamzerella but you already using and relying on polyfills. In every test file you have html5-shiv and media-query polyfill for breakpoints from core globals (AU-media).
For example grid-12 wouldn't work in ie8 separately if developer wouldn't apply media-query polyfill manually.

Can you explain, please, why you are refusing to use ie8 polyfills here? es5 requirement and polyfills for ie8 will solve this problem.

@azerella
Copy link
Contributor Author

azerella commented Apr 3, 2019

@toxamiz We are relying on polyfills where it makes sense. We are currently using html5shiv.js and respond.js as you've seen in the test/ files. This provides HTML5 and media functionality for older browsers. We do not ship the components with any shiv / shim libraries.

Linting and shivs are unrelated to one another. We need a way to lint our vanilla JavaScript so that it's extremely compatibility across browsers, this means linting for things like using for( ... ) over forEach or issues like var over const / let.

You're right in saying we could just polyfill when we transpile the vanilla JavaScript but this isn't always going to work ( babel isn't perfect ) and it would increase our bundle sizes.

@sukhrajghuman sukhrajghuman removed this from the Sprint 126 milestone Apr 3, 2019
@sukhrajghuman sukhrajghuman moved this from ✏️ Sprint backlog to 🌱 Product Backlog in Design System May 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request.
Projects
Design System
  
🌱 Product Backlog
Development

Successfully merging this pull request may close these issues.

None yet

3 participants