Skip to content

Commit

Permalink
Disable es-x/no-symbol-prototype-description
Browse files Browse the repository at this point in the history
Also fix inheritance order so rule is not re-enabled
when loading newer versions of ES.

Part of #477
  • Loading branch information
edg2s authored and jdforrester committed Oct 31, 2022
1 parent bafeb8c commit b2ac22a
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 20 deletions.
4 changes: 2 additions & 2 deletions language/es2016.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"plugins": [ "es-x" ],
"extends": [
"./rules-es2016",
"plugin:es-x/restrict-to-es2016",
"plugin:es-x/no-new-in-esnext"
"plugin:es-x/no-new-in-esnext",
"./rules-es2016"
],
"parserOptions": {
"ecmaVersion": 2016
Expand Down
4 changes: 2 additions & 2 deletions language/es2017.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"plugins": [ "es-x" ],
"extends": [
"./rules-es2017",
"plugin:es-x/restrict-to-es2017",
"plugin:es-x/no-new-in-esnext"
"plugin:es-x/no-new-in-esnext",
"./rules-es2017"
],
"parserOptions": {
"ecmaVersion": 2017
Expand Down
4 changes: 2 additions & 2 deletions language/es2018.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"plugins": [ "es-x" ],
"extends": [
"./rules-es2018",
"plugin:es-x/restrict-to-es2018",
"plugin:es-x/no-new-in-esnext"
"plugin:es-x/no-new-in-esnext",
"./rules-es2018"
],
"parserOptions": {
"ecmaVersion": 2018
Expand Down
4 changes: 2 additions & 2 deletions language/es2019.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"plugins": [ "es-x" ],
"extends": [
"./rules-es2019",
"plugin:es-x/restrict-to-es2019",
"plugin:es-x/no-new-in-esnext"
"plugin:es-x/no-new-in-esnext",
"./rules-es2019"
],
"parserOptions": {
"ecmaVersion": 2019
Expand Down
4 changes: 2 additions & 2 deletions language/es2020.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"plugins": [ "es-x" ],
"extends": [
"./rules-es2020",
"plugin:es-x/restrict-to-es2020",
"plugin:es-x/no-new-in-esnext"
"plugin:es-x/no-new-in-esnext",
"./rules-es2020"
],
"parserOptions": {
"ecmaVersion": 2020
Expand Down
4 changes: 2 additions & 2 deletions language/es2021.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"plugins": [ "es-x" ],
"extends": [
"./rules-es2021",
"plugin:es-x/restrict-to-es2021",
"plugin:es-x/no-new-in-esnext"
"plugin:es-x/no-new-in-esnext",
"./rules-es2021"
],
"parserOptions": {
"ecmaVersion": 2021
Expand Down
4 changes: 2 additions & 2 deletions language/es2022.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"plugins": [ "es-x" ],
"extends": [
"./rules-es2022",
"plugin:es-x/restrict-to-es2022"
"plugin:es-x/restrict-to-es2022",
"./rules-es2022"
],
"parserOptions": {
"ecmaVersion": 2022
Expand Down
4 changes: 2 additions & 2 deletions language/es5.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"plugins": [ "es-x" ],
"extends": [
"./rules-es5",
"plugin:es-x/restrict-to-es5",
"plugin:es-x/no-new-in-esnext"
"plugin:es-x/no-new-in-esnext",
"./rules-es5"
],
"parserOptions": {
"ecmaVersion": 5
Expand Down
4 changes: 2 additions & 2 deletions language/es6.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"plugins": [ "es-x" ],
"extends": [
"./rules-es6",
"plugin:es-x/restrict-to-es2015",
"plugin:es-x/no-new-in-esnext"
"plugin:es-x/no-new-in-esnext",
"./rules-es6"
],
"parserOptions": {
"ecmaVersion": 6
Expand Down
6 changes: 5 additions & 1 deletion language/rules-es5.json
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
{}
{
"rules": {
"es-x/no-symbol-prototype-description": "off"
}
}
8 changes: 7 additions & 1 deletion test/fixtures/client-es5/valid.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,11 @@
var $div;
// [].find should be disabled, but it conflicts with jQuery
// Off: es-x/no-array-prototype-find
$div.find();
$div.find(
// Symbol.prototype.descrition is disabled, but conflicts
// with many plain object properties.
// Off: es-x/no-symbol-prototype-description
$div.description
);

}() );
5 changes: 5 additions & 0 deletions test/fixtures/client-es6/valid.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,9 @@
// Valid: es-x/no-string-raw
String.raw();

// Symbol.prototype.descrition is disabled, but conflicts
// with many plain object properties.
// Off: es-x/no-symbol-prototype-description
// eslint-disable-next-line no-unused-expressions
node.description;
}() );
7 changes: 7 additions & 0 deletions test/fixtures/server/valid.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,11 @@

// Off: node/no-extraneous-require

// ES 019
// Symbol.prototype.descrition is disabled, but conflicts
// with many plain object properties.
// Off: es-x/no-symbol-prototype-description
// eslint-disable-next-line no-unused-expressions
a.description;

}( this ) );

0 comments on commit b2ac22a

Please sign in to comment.