Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
working-directory: sonar-plugin

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
uses: SonarSource/sonarqube-scan-action@master
if: |
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) &&
matrix.node-version == '20.x' &&
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ The standalone version of the ESLint plugin is available from [npmjs](https://np

| Plugins Version | SonarQube version | ESLint version |
| --------------- | ----------------- | -------------- |
| 1.4.+, 1.5.+ | 9.9.+ LTA to 25.1 | 7+ |
| 2.+ | 9.9.+ LTA to 25.1 | 7+ |
| 1.4, 1.5 | 9.9.+ LTA to 10.7 | 7+ |

## 🤝 Contribution

Expand Down
893 changes: 0 additions & 893 deletions eslint-plugin/.yarn/releases/yarn-4.1.1.cjs

This file was deleted.

934 changes: 934 additions & 0 deletions eslint-plugin/.yarn/releases/yarn-4.6.0.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion eslint-plugin/.yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.1.1.cjs
yarnPath: .yarn/releases/yarn-4.6.0.cjs
10 changes: 10 additions & 0 deletions eslint-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ Add `@creedengo` to the `plugins` section of your `.eslintrc`, followed by rules
}
```

## ⚙ Configs

<!-- begin auto-generated configs list -->

| | Name |
| :- | :------------ |
| ✅ | `recommended` |

<!-- end auto-generated configs list -->

## 🔨 Rules

<!-- begin auto-generated rules list -->
Expand Down
31 changes: 20 additions & 11 deletions eslint-plugin/docs/rules/no-import-all-from-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ leading to faster execution and improved overall performance.

## Options

<!-- begin auto-generated rule options list -->

| Name | Type |
| :------------------------------------- | :------- |
| `importByNamespaceNotAllowedLibraries` | String[] |
| `notAllowedLibraries` | String[] |

<!-- end auto-generated rule options list -->

You can externally add your own libraries to be checked.
To add your own libraries you need to modify your .eslintrc.js by adding the following rule configuration:

Expand Down Expand Up @@ -52,10 +61,10 @@ import _ from "underscore";

**Size of your bundle, if you use the whole lodash library:**

* **index.js - 531.46 KB**
* node_modules/lodash - 531.35 KB
* lodash.js - 531.35 KB
* index.js - 112 B
- **index.js - 531.46 KB**
- node_modules/lodash - 531.35 KB
- lodash.js - 531.35 KB
- index.js - 112 B

---

Expand All @@ -72,13 +81,13 @@ import map from "underscore/modules/map.js";

Size of your bundle, if you use only the "isEmpty" method:

* **index.js - 24.42 KB**
* node_modules/lodash - 24.31 KB
* isEmpty - 1.95 KB
* _nodeUtil.js - 995 B
* isArrayLike.js - 830 B
* ...
* index.js - 110 B
- **index.js - 24.42 KB**
- node_modules/lodash - 24.31 KB
- isEmpty - 1.95 KB
- \_nodeUtil.js - 995 B
- isArrayLike.js - 830 B
- ...
- index.js - 110 B

## Resources

Expand Down
24 changes: 12 additions & 12 deletions eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,27 @@
"update:eslint-docs": "eslint-doc-generator"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.56.0",
"@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^6.4.1",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-doc-generator": "^1.7.0",
"eslint-plugin-eslint-plugin": "^5.4.0",
"eslint-plugin-license-header": "^0.6.0",
"eslint-doc-generator": "1.7.0",
"eslint-plugin-eslint-plugin": "^6.4.0",
"eslint-plugin-license-header": "^0.6.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-prettier": "^5.2.3",
"mkdirp": "^3.0.1",
"mocha": "^10.3.0",
"nyc": "^15.1.0",
"prettier": "^3.2.5",
"mocha": "^11.0.1",
"nyc": "^17.1.0",
"prettier": "^3.4.2",
"rimraf": "^5.0.5",
"typescript": "^5.3.3"
"typescript": "~5.3.3"
},
"engines": {
"node": "^14.17.0 || ^16.0.0 || >= 18.0.0"
},
"peerDependencies": {
"eslint": ">=7"
},
"packageManager": "yarn@4.1.1"
"packageManager": "yarn@4.6.0"
}
59 changes: 30 additions & 29 deletions eslint-plugin/tests/lib/rules/prefer-collections-with-pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const RuleTester = require("eslint").RuleTester;
//------------------------------------------------------------------------------

const ruleTester = new RuleTester({
// eslint-disable-next-line node/no-missing-require
parser: require.resolve("@typescript-eslint/parser"),
});

Expand All @@ -46,35 +47,35 @@ ruleTester.run("prefer-collections-with-pagination", rule, {
valid: [
`
@Controller()
public class Test {
class Test {
@Get()
public find(): Page {}
}
`,
`
@Controller()
public class Test {
class Test {
@Get()
public find(): Promise<Pagination> {}
}
`,
`
@Controller()
public class Test {
class Test {
@Get()
public find() {}
}
`,
`
@Controller()
public class Test {
class Test {
@Get(':id')
public findOne(): Promise<string> {}
}
`,
`
@Controller()
public class Test {
class Test {
@Get()
public find(): Promise<{items: string[], currentPage: number, totalPages: number}> {}
}
Expand All @@ -83,42 +84,42 @@ ruleTester.run("prefer-collections-with-pagination", rule, {
invalid: [
{
code: `
@Controller()
public class Test {
@Get()
public find(): Promise<string[]> {}
}
`,
@Controller()
class Test {
@Get()
public find(): Promise<string[]> {}
}
`,
errors: [expectedReferenceError],
},
{
code: `
@Controller()
public class Test {
@Get()
public find(): Promise<ClassicList> {}
}
`,
@Controller()
class Test {
@Get()
public find(): Promise<ClassicList> {}
}
`,
errors: [expectedReferenceError],
},
{
code: `
@Controller()
public class Test {
@Get()
public find(): string[] {}
}
`,
@Controller()
class Test {
@Get()
public find(): string[] {}
}
`,
errors: [expectedArrayError],
},
{
code: `
@Controller()
public class Test {
@Get()
public find(): Promise<{items: string[]}> {}
}
`,
@Controller()
class Test {
@Get()
public find(): Promise<{items: string[]}> {}
}
`,
errors: [expectedReferenceError],
},
],
Expand Down
Loading
Loading