? Pending

User tests: Successful: Unsuccessful:

avatar dneukirchen
dneukirchen
10 Feb 2018

Currently we are not checking the js codestyle at all. I was told that we are trying to use the airbnb codestyles. I checked media/system/core.js and it has 2300 cs errors (thats more than 2 per line) so its time to improve things here.

Airbnb code styles are widely accepted, more info: https://github.com/airbnb/javascript

This PR prepares js code style checks.

Changes

  • Use airbnb eslint config
  • Rename scripts

Changes to scripts

  • npm run compile-js is now npm run build:js
  • npm run compile-sass is now npm run build:css
  • Introduced new script npm run lint:js to check javascript cs (currently only for es6 and not used in ci so far)
  • npm run update-dependencies is now npm run update

Documentation changes

Yes, we need to update code styles (which are outdated): https://developer.joomla.org/coding-standards/javascript.html (can be addopted from https://github.com/airbnb/javascript)

avatar dneukirchen dneukirchen - open - 10 Feb 2018
avatar dneukirchen dneukirchen - change - 10 Feb 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 10 Feb 2018
Category Repository
avatar dneukirchen dneukirchen - change - 10 Feb 2018
The description was changed
avatar dneukirchen dneukirchen - edited - 10 Feb 2018
avatar dneukirchen dneukirchen - change - 10 Feb 2018
The description was changed
avatar dneukirchen dneukirchen - edited - 10 Feb 2018
avatar dneukirchen dneukirchen - change - 10 Feb 2018
The description was changed
avatar dneukirchen dneukirchen - edited - 10 Feb 2018
avatar brianteeman brianteeman - change - 10 Feb 2018
Title
Setup eslint for es6
[4.0] Setup eslint for es6
avatar brianteeman brianteeman - edited - 10 Feb 2018
avatar brianteeman
brianteeman - comment - 10 Feb 2018

(updated title to show 4.0)

avatar dneukirchen dneukirchen - change - 10 Feb 2018
The description was changed
avatar dneukirchen dneukirchen - edited - 10 Feb 2018
avatar dneukirchen dneukirchen - change - 10 Feb 2018
The description was changed
avatar dneukirchen dneukirchen - edited - 10 Feb 2018
avatar dgt41
dgt41 - comment - 10 Feb 2018

@wilsonge this is ready for merging

avatar dneukirchen dneukirchen - change - 10 Feb 2018
The description was changed
avatar dneukirchen dneukirchen - edited - 10 Feb 2018
avatar laoneo
laoneo - comment - 10 Feb 2018

Can a small file in core being converted that we can see the new cs rules live?

avatar dneukirchen
dneukirchen - comment - 10 Feb 2018

I will include an example in the next PR (together with the changes required for es6 support).

for now:

  1. Create a file anywhere in the project codestyle.es6.js with the following contents:
export default class Codestyle {
  sayHello() {
    console.log('hello');
  }
}

  1. Run npm install and npm run lint:js

  2. See linting works as expected.

bildschirmfoto 2018-02-10 um 23 00 39

avatar wilsonge wilsonge - change - 11 Feb 2018
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-02-11 22:16:02
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 11 Feb 2018
avatar wilsonge wilsonge - merge - 11 Feb 2018

Add a Comment

Login with GitHub to post a comment