Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade eslint-plugin-sonarjs to 0.12.0 #2967

Merged
merged 4 commits into from
Feb 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions eslint-bridge/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion eslint-bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"bytes": "3.1.0",
"eslint": "7.32.0",
"eslint-plugin-chai-friendly": "0.7.2",
"eslint-plugin-sonarjs": "0.12.0-504",
"eslint-plugin-sonarjs": "0.12.0",
"express": "4.17.1",
"functional-red-black-tree": "1.0.1",
"regexpp": "3.2.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
'angular.js:src/ngMock/angular-mocks.js':[
2115,
],
'angular.js:src/ngParseExt/ucd.js':[
561,
1215,
],
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
{
'javascript-test-sources:src/ecmascript6/Ghost/core/client/app/components/gh-tags-management-container.js':[
41,
],
'javascript-test-sources:src/ecmascript6/Ghost/core/client/app/mixins/ed-editor-scroll.js':[
19,
],
'javascript-test-sources:src/ecmascript6/Ghost/core/client/app/mixins/editor-base-controller.js':[
162,
],
'javascript-test-sources:src/ecmascript6/Ghost/core/server/api/utils.js':[
299,
],
'javascript-test-sources:src/ecmascript6/Ghost/core/server/middleware/auth.js':[
54,
],
'javascript-test-sources:src/ecmascript6/Ghost/core/server/middleware/check-ssl.js':[
7,
],
}
9 changes: 9 additions & 0 deletions its/ruling/src/test/expected/js/jshint/javascript-S1126.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
'jshint:src/jshint.js':[
127,
178,
],
'jshint:src/state.js':[
40,
],
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
'p5.js:lib/addons/p5.sound.js':[
1926,
2169,
],
}
6 changes: 0 additions & 6 deletions its/ruling/src/test/expected/js/p5.js/javascript-S4624.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
'prototype:src/prototype/dom/dom.js':[
99,
774,
],
}
5 changes: 5 additions & 0 deletions its/ruling/src/test/expected/js/qunit/javascript-S1126.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
'qunit:src/equiv.js':[
54,
],
}
4 changes: 0 additions & 4 deletions its/ruling/src/test/expected/ts/console/typescript-S4624.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
'console:src/utils/valueparser.ts':[
30,
34,
],
'console:src/views/models/DatabrowserView/Cell/SelectNodesCell/SelectNodesCell.tsx':[
324,
334,
Expand Down
28 changes: 0 additions & 28 deletions its/ruling/src/test/expected/ts/postgraphql/typescript-S4624.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,12 @@
138,
141,
],
'postgraphql:src/postgraphql/withPostGraphQLContext.ts':[
176,
],
'postgraphql:src/postgres/inventory/__tests__/conditionToSql-test.ts':[
14,
],
'postgraphql:src/postgres/inventory/addPgCatalogToInventory.ts':[
65,
],
'postgraphql:src/postgres/inventory/collection/PgCollection.ts':[
164,
166,
],
'postgraphql:src/postgres/inventory/collection/PgCollectionKey.ts':[
172,
176,
179,
233,
237,
],
'postgraphql:src/postgres/inventory/paginator/PgPaginatorOrderingAttributes.ts':[
83,
92,
99,
99,
],
'postgraphql:src/postgres/inventory/paginator/PgPaginatorOrderingOffset.ts':[
132,
132,
134,
],
'postgraphql:src/postgres/inventory/type/custom/pgIntervalType.ts':[
91,
],
'postgraphql:src/postgres/utils/__tests__/sql-test.ts':[
154,
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
*/
package org.sonar.javascript.checks;

import java.util.Collections;
import java.util.List;

import org.sonar.check.Rule;
import org.sonar.plugins.javascript.api.EslintBasedCheck;
import org.sonar.plugins.javascript.api.JavaScriptRule;
Expand All @@ -29,6 +32,13 @@
@Rule(key = "S4144")
public class IdenticalFunctionsCheck implements EslintBasedCheck {

private static final int DEFAULT_THRESHOLD = 3;

@Override
public List<Object> configurations() {
return Collections.singletonList(DEFAULT_THRESHOLD);
}

@Override
public String eslintKey() {
return "no-identical-functions";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* SonarQube JavaScript Plugin
* Copyright (C) 2011-2022 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.javascript.checks;

import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

class IdenticalFunctionsCheckTest {

@Test
void configurations() {
IdenticalFunctionsCheck identicalFunctionsCheck = new IdenticalFunctionsCheck();
assertThat(identicalFunctionsCheck.configurations()).containsExactly(3);
}
}