Skip to content

Commit 2572866

Browse files
committed
Merge branch 'main' into plugins/knip-fix-1
# Conflicts: # package-lock.json # package.json
2 parents db54139 + 8be150c commit 2572866

File tree

152 files changed

+20008
-10942
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+20008
-10942
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 40 deletions
This file was deleted.

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,8 @@ testem.log
4040
Thumbs.db
4141

4242
.nx
43+
44+
vite.config.*.timestamp*
45+
vitest.config.*.timestamp*
46+
.cursor/rules/nx-rules.mdc
47+
.github/instructions/nx.instructions.md

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24.1.0

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"eslint.validate": ["json"]
2+
"eslint.validate": ["json"],
3+
"kiroAgent.configureMCP": "Disabled"
34
}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Changelog

CONTRIBUTING.MD

Lines changed: 0 additions & 36 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Contributing to Code-Pushup Community Plugins
2+
3+
Welcome to the Code-Pushup Community Plugins repository! This space is designed for the community to create, share, and publish their own plugins. We're excited to see your contributions.
4+
5+
## Minimum Requirements for Plugin Submissions
6+
7+
To maintain high quality and usability standards, please ensure your plugin meets the following criteria before submission:
8+
9+
### 1. Documentation
10+
11+
- Your code must be well-documented
12+
- Include clear descriptions of functionality and usage
13+
- Provide API documentation where applicable
14+
- Provide a readme file in the root of your plugin, determining the plugin name, description, and usage instructions
15+
16+
### 2. Testing Coverage
17+
18+
- Implement comprehensive unit tests
19+
- Include integration tests
20+
- Maintain good test coverage metrics
21+
22+
### 3. Code Quality
23+
24+
- Code must be properly linted
25+
- It must be formatted too
26+
27+
### 4. Examples
28+
29+
- Include an `examples` directory in your plugin
30+
- Provide at least one `basic-setup` example
31+
- Ensure examples are:
32+
- Easy to reproduce
33+
- Quick to execute
34+
- Demonstrate core functionality
35+
- Well-documented with setup instructions
36+
37+
For reference, you can find plugins examples in our [CLI repository](https://github.com/code-pushup/cli/tree/main/packages), including plugins for ESLint, TypeScript, JSDoc, Lighthouse, and more. These can serve as templates for your own plugin implementation.
38+
39+
We look forward to your contributions! If you have any questions, feel free to open an issue for discussion.

README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,41 @@
22

33
<a alt="code-pushup logo" href="https://code-pushup.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/code-pushup/cli/master/packages/cli/docs/images/logo.png" width="45"></a>
44

5-
**This is the repository for all our plugin examples.**
5+
**Welcome to the Code-Pushup Community Plugins Repository!**
6+
7+
This repository serves as a central hub for community-created plugins for Code-Pushup. Here you'll find a collection of plugins developed by the community to extend Code-Pushup's functionality.
8+
9+
## What is Code-Pushup?
10+
11+
Code-Pushup is a tool that helps you measure and track your code quality metrics. For more information, visit our [official website](https://code-pushup.dev).
12+
13+
## Available Plugins
14+
15+
This section will list community plugins as they are added. Each plugin will include:
16+
17+
- Brief description
18+
- Installation instructions
19+
- Basic usage example
20+
- Link to detailed documentation
21+
22+
## Creating Your Own Plugin
23+
24+
Want to contribute? Great! You can create your own plugin and share it with the community. Check out our [CONTRIBUTING.md](./CONTRIBUTING.md) guide for:
25+
26+
- Minimum requirements
27+
- Development guidelines
28+
- Submission process
29+
30+
For reference implementations, see our [official plugins](https://github.com/code-pushup/cli/tree/main/packages) in the CLI repository.
31+
32+
## Getting Started
33+
34+
1. Browse the available plugins
35+
2. Follow each plugin's installation and setup instructions
36+
3. Configure the plugin in your Code-Pushup configuration
37+
4. Run Code-Pushup to start measuring your code quality
38+
39+
## Need Help?
40+
41+
- 🤔 Open an [issue](https://github.com/code-pushup/community-plugins/issues) for questions
42+
- 🐛 Report bugs in the respective plugin's issue section

eslint.config.js

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
import nxEslintPlugin from '@nx/eslint-plugin';
2+
import jestExtendedPlugin from 'eslint-plugin-jest-extended';
3+
import jsoncParser from 'jsonc-eslint-parser';
4+
import fs from 'node:fs';
5+
import tseslint from 'typescript-eslint';
6+
import node from '@code-pushup/eslint-config/node.js';
7+
import typescript from '@code-pushup/eslint-config/typescript.js';
8+
import vitest from '@code-pushup/eslint-config/vitest.js';
9+
10+
export default tseslint.config(
11+
...typescript,
12+
...node,
13+
...vitest,
14+
{
15+
settings: {
16+
'import/resolver': {
17+
typescript: {
18+
project: 'tsconfig.base.json',
19+
alwaysTryTypes: true,
20+
extensions: ['.ts', '.tsx', '.d.ts', '.js', '.jsx'],
21+
},
22+
node: {
23+
extensions: ['.ts', '.tsx', '.d.ts', '.js', '.jsx'],
24+
},
25+
},
26+
},
27+
},
28+
{ plugins: { '@nx': nxEslintPlugin } },
29+
{
30+
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
31+
rules: {
32+
'@nx/enforce-module-boundaries': [
33+
'error',
34+
{
35+
enforceBuildableLibDependency: true,
36+
allow: [
37+
String.raw`^.*/eslint(\.base)?\.config\.[cm]?js$`,
38+
String.raw`^.*/code-pushup\.(config|preset)(\.m?[jt]s)?$`,
39+
'^[./]+/tools/.*$',
40+
String.raw`^[./]+/(testing/)?test-setup-config/src/index\.js$`,
41+
],
42+
depConstraints: [
43+
{
44+
sourceTag: 'scope:shared',
45+
onlyDependOnLibsWithTags: ['scope:shared'],
46+
},
47+
{
48+
sourceTag: 'scope:core',
49+
onlyDependOnLibsWithTags: ['scope:core', 'scope:shared'],
50+
},
51+
{
52+
sourceTag: 'scope:plugin',
53+
onlyDependOnLibsWithTags: ['scope:shared'],
54+
},
55+
{
56+
sourceTag: 'scope:tooling',
57+
onlyDependOnLibsWithTags: ['scope:tooling', 'scope:shared'],
58+
},
59+
{
60+
sourceTag: 'type:e2e',
61+
onlyDependOnLibsWithTags: [
62+
'type:app',
63+
'type:feature',
64+
'type:util',
65+
'type:testing',
66+
],
67+
},
68+
{
69+
sourceTag: 'type:app',
70+
onlyDependOnLibsWithTags: [
71+
'type:feature',
72+
'type:util',
73+
'type:testing',
74+
],
75+
},
76+
{
77+
sourceTag: 'type:feature',
78+
onlyDependOnLibsWithTags: [
79+
'type:feature',
80+
'type:util',
81+
'type:testing',
82+
],
83+
},
84+
{
85+
sourceTag: 'type:util',
86+
onlyDependOnLibsWithTags: ['type:util', 'type:testing'],
87+
},
88+
{
89+
sourceTag: 'type:testing',
90+
onlyDependOnLibsWithTags: ['type:util', 'type:testing'],
91+
},
92+
],
93+
},
94+
],
95+
},
96+
},
97+
{
98+
files: ['**/*.test.ts', '**/*.spec.ts'],
99+
plugins: { 'jest-extended': jestExtendedPlugin },
100+
rules: {
101+
'vitest/consistent-test-filename': [
102+
'warn',
103+
{
104+
pattern: String.raw`.*\.(bench|type|unit|int|e2e)\.test\.[tj]sx?$`,
105+
},
106+
],
107+
'jest-extended/prefer-to-be-array': 'warn',
108+
'jest-extended/prefer-to-be-false': 'warn',
109+
'jest-extended/prefer-to-be-object': 'warn',
110+
'jest-extended/prefer-to-be-true': 'warn',
111+
'jest-extended/prefer-to-have-been-called-once': 'warn',
112+
},
113+
},
114+
{
115+
files: ['**/*.type.test.ts'],
116+
rules: {
117+
'vitest/expect-expect': 'off',
118+
},
119+
},
120+
{
121+
files: ['**/*.json'],
122+
languageOptions: { parser: jsoncParser },
123+
},
124+
{
125+
files: ['**/*.ts', '**/*.js'],
126+
rules: {
127+
'n/file-extension-in-import': ['error', 'always'],
128+
'unicorn/number-literal-case': 'off',
129+
},
130+
},
131+
{
132+
files: ['**/perf/**/*.ts'],
133+
rules: {
134+
'@typescript-eslint/no-magic-numbers': 'off',
135+
'sonarjs/no-duplicate-string': 'off',
136+
},
137+
},
138+
{
139+
// tests need only be compatible with local Node version
140+
// publishable packages should pick up version range from "engines" in their package.json
141+
files: ['e2e/**/*.ts', 'testing/**/*.ts', '**/*.test.ts'],
142+
settings: {
143+
node: {
144+
version: fs.readFileSync('.node-version', 'utf8'),
145+
},
146+
},
147+
},
148+
{
149+
ignores: [
150+
'**/*.mock.*',
151+
'**/code-pushup.config.ts',
152+
'**/mocks/fixtures/**',
153+
'**/__snapshots__/**',
154+
'**/dist',
155+
'**/*.md',
156+
],
157+
},
158+
);

0 commit comments

Comments
 (0)