Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 610ccd0

Browse files
authored
Merge pull request #2631 from loginesta/AC-1509
AC-1509: Remove outdated JSCS static from magento
2 parents e3a1b80 + fdca208 commit 610ccd0

File tree

4 files changed

+11
-24
lines changed

4 files changed

+11
-24
lines changed

src/common/images/static-jscs.png

-59.6 KB
Binary file not shown.

src/guides/v2.3/coding-standards/code-standard-javascript.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ Use [RFC 2119](http://www.ietf.org/rfc/rfc2119.txt) to interpret the "must," "mu
1414
Magento uses the [jQuery library][jquery] including standard and custom [jQuery widgets][jquery-widgets].
1515
For the jQuery widget coding standard, see [jQuery widget coding standard][jquery-widget-coding-standard].
1616

17-
## Eslint and JSCS tools
17+
## Eslint code analysis
1818

19-
Use [ESLint][eslint] and `JSCS` to ensure the quality of your JavaScript code.
19+
Use [ESLint][eslint] to ensure the quality of your JavaScript code.
2020

2121
ESLint is a community-driven tool that detects errors and potential problems in JavaScript code.
2222
It can use custom rules to enforce specific coding standards.
2323

2424
* [Magento ESLint Rules][eslint-rules]
25-
* [Magento JSCS Rules][jscs-rules]
2625

2726
## Additional formatting standards
2827

@@ -360,4 +359,3 @@ var foo = 'bar',
360359
[jquery-widget-coding-standard]: {{ page.baseurl }}/coding-standards/code-standard-jquery-widgets.html
361360
[eslint]: http://eslint.org/
362361
[eslint-rules]: https://github.com/magento/magento-coding-standard/blob/develop/eslint/.eslintrc-magento
363-
[jscs-rules]: https://github.com/magento/magento-coding-standard/blob/develop/jscs/.jscsrc

src/guides/v2.3/test/static/static-analysis.md

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,20 @@ For all of the static configuration installations below involving the PHPStorm P
1919

2020
## Javascript Code Style check
2121

22-
{:.bs-callout-info}
23-
JSCS is deprecated in PHPStorm 2020.2. You must install the JSCS plugin.
24-
25-
{:.procedure}
26-
To install the JSCS plugin:
27-
28-
1. Go to PHPStorm preferences > Languages & Frameworks > JavaScript > Code Quality Tools > JSCS.
29-
1. Check **Enable**, if it is unchecked.
30-
1. Enter the path to your node binary (the result of outputting `which node` in your terminal).
31-
1. Enter the path to your JSCS package: `[magento_root]/node_modules/jscs`
32-
1. Click **Configuration File** and in the adjacent input field enter the path to the JSCS file Magento uses, which is located in: `https://github.com/magento/magento-coding-standard/blob/develop/jscs/.jscsrc`
22+
{:.bs-callout-warning}
23+
[JSCS package has been deprecated](https://www.npmjs.com/package/jscs) and [merged with ESLint](https://eslint.org/blog/2016/04/welcoming-jscs-to-eslint).
3324

34-
![JSCS config]({{site.baseurl}}/common/images/static-jscs.png)
25+
### ESLint
3526

36-
To verify it works, in any JS file add `snake_case: [],` to any object literal, and you should see a warning about not using camel case for the object key.
37-
38-
## ESLint
27+
{:.bs-callout-info}
28+
Javascript code analysis is done through [ESLint]({{site.baseurl}}/guides/v2.4/coding-standards/code-standard-javascript.html#eslint-code-analysis).
29+
The ESLint rules are set up in `magento-coding-standard`, which is installed on Magento2 via `composer` since it's a development dependency.
3930

4031
1. Go to PHPStorm preferences > Languages & Frameworks > JavaScript > Code Quality Tools > ESLint.
4132
1. Click **Manual ESLint configuration**.
4233
1. Fill in the adjacent input fields with the path to your node binary (the result of outputting `which node` in your terminal).
4334
1. Enter the path to your ESLint package: `[magento_root]/node_modules/eslint`
44-
1. Click **Configuration File** and in the adjacent input field enter the path to the ESLint file Magento uses, which is located in `dev/tests/static/testsuite/Magento/Test/Js/_files/eslint/.eslintrc-magento`.
35+
1. Click **Configuration File** and in the adjacent input field enter the path to the ESLint file Magento uses, which is located in `vendor/magento/magento-coding-standard/eslint/.eslintrc-magento`.
4536

4637
See the image below for example configuration:
4738

src/guides/v2.4/coding-standards/code-standard-javascript.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ Use [RFC 2119](http://www.ietf.org/rfc/rfc2119.txt) to interpret the "must," "mu
1414
Magento uses the [jQuery library][jquery] including standard and custom [jQuery widgets][jquery-widgets].
1515
For the jQuery widget coding standard, see [jQuery widget coding standard][jquery-widget-coding-standard].
1616

17-
## Eslint and JSCS tools
17+
## Eslint code analysis
1818

19-
Use [ESLint][eslint] and `JSCS` to ensure the quality of your JavaScript code.
19+
Use [ESLint][eslint] to ensure the quality of your JavaScript code.
2020

2121
ESLint is a community-driven tool that detects errors and potential problems in JavaScript code.
2222
It can use custom rules to enforce specific coding standards.
2323

2424
* [Magento ESLint Rules][eslint-rules]
25-
* [Magento JSCS Rules][jscs-rules]
2625

2726
## Additional formatting standards
2827

@@ -368,6 +367,5 @@ The source code of the rules can be found in the [Eslint custom rules folder][es
368367
[jquery-widget-coding-standard]: {{ page.baseurl }}/coding-standards/code-standard-jquery-widgets.html
369368
[eslint]: http://eslint.org/
370369
[eslint-rules]: https://github.com/magento/magento-coding-standard/blob/develop/eslint/.eslintrc-magento
371-
[jscs-rules]: https://github.com/magento/magento-coding-standard/blob/develop/jscs/.jscsrc
372370
[grunt-eslint-configuration]: {{ site.mage2bloburl }}/{{ page.guide_version }}/dev/tools/grunt/configs/eslint.json
373371
[eslint-custom-rules-folder]: {{ site.mage2bloburl }}/{{ page.guide_version }}/dev/tests/static/testsuite/Magento/Test/Js/_files/eslint/rules/

0 commit comments

Comments
 (0)