Skip to content

Commit 472f1b1

Browse files
committed
Fix linting issues
Signed-off-by: Daniel Krook <krook@linux.com>
1 parent 909571a commit 472f1b1

23 files changed

+23249
-17695
lines changed

.github/issue_template.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
**Is your feature request related to a problem? Please describe.**
2-
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
1+
**Is your feature request related to a problem? Please describe.** A clear and concise description
2+
of what the problem is. Ex. I'm always frustrated when [...]
33

4-
**Describe the solution you'd like**
5-
A clear and concise description of what you want to happen.
4+
**Describe the solution you'd like** A clear and concise description of what you want to happen.
65

7-
**Describe alternatives you've considered**
8-
A clear and concise description of any alternative solutions or features you've considered.
6+
**Describe alternatives you've considered** A clear and concise description of any alternative
7+
solutions or features you've considered.
98

10-
**Additional context**
11-
Add any other context or screenshots about the feature request here.
9+
**Additional context** Add any other context or screenshots about the feature request here.

.github/pull_request_template.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
**Describe at a high level the solution you're providing**
2-
A clear and concise description of what you changed.
1+
**Describe at a high level the solution you're providing** A clear and concise description of what
2+
you changed.
33

4-
**Is this a patch, a minor version change, or a major version change**
5-
Patch, minor, or major.
4+
**Is this a patch, a minor version change, or a major version change** Patch, minor, or major.
65

7-
**Is this related to an open issue?**
8-
Please provide the link.
6+
**Is this related to an open issue?** Please provide the link.
97

10-
**Additional context**
11-
Add any other technical detail or considerations here.
8+
**Additional context** Add any other technical detail or considerations here.

.prettierrc.cjs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Shared Prettier configuration for all Pyrrha projects
2+
// Based on proven Pyrrha-Dashboard configuration
3+
module.exports = {
4+
// Core formatting rules (from Dashboard .prettierrc)
5+
singleQuote: true,
6+
bracketSameLine: true, // Updated from deprecated jsxBracketSameLine
7+
8+
// Additional standardization
9+
semi: true,
10+
trailingComma: 'es5',
11+
printWidth: 80,
12+
tabWidth: 2,
13+
useTabs: false,
14+
15+
// Language-specific overrides
16+
overrides: [
17+
{
18+
files: '*.json',
19+
options: {
20+
printWidth: 120,
21+
},
22+
},
23+
{
24+
files: '*.md',
25+
options: {
26+
printWidth: 100,
27+
proseWrap: 'always',
28+
},
29+
},
30+
{
31+
files: '*.scss',
32+
options: {
33+
singleQuote: false,
34+
},
35+
},
36+
{
37+
files: '*.{js,jsx}',
38+
options: {
39+
singleQuote: true,
40+
bracketSameLine: true, // Updated from deprecated jsxBracketSameLine
41+
},
42+
},
43+
],
44+
};

.prettierrc.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Shared Prettier configuration for all Pyrrha projects
2+
// Based on proven Pyrrha-Dashboard configuration
3+
module.exports = {
4+
// Core formatting rules (from Dashboard .prettierrc)
5+
singleQuote: true,
6+
bracketSameLine: true, // Updated from deprecated jsxBracketSameLine
7+
8+
// Additional standardization
9+
semi: true,
10+
trailingComma: 'es5',
11+
printWidth: 80,
12+
tabWidth: 2,
13+
useTabs: false,
14+
15+
// Language-specific overrides
16+
overrides: [
17+
{
18+
files: '*.json',
19+
options: {
20+
printWidth: 120,
21+
},
22+
},
23+
{
24+
files: '*.md',
25+
options: {
26+
printWidth: 100,
27+
proseWrap: 'always',
28+
},
29+
},
30+
{
31+
files: '*.scss',
32+
options: {
33+
singleQuote: false,
34+
},
35+
},
36+
{
37+
files: '*.{js,jsx}',
38+
options: {
39+
singleQuote: true,
40+
bracketSameLine: true, // Updated from deprecated jsxBracketSameLine
41+
},
42+
},
43+
],
44+
};

CONTRIBUTING.md

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
# Contributing
22

3-
When contributing a major change to this repository, please first discuss the change you wish to make via an [issue](contributing/ISSUES.md) or via
4-
[Slack in the #prometeo-pyrrha channel](https://callforcode.org/slack). Minor issues can simply be addressed by sending by a pull request.
3+
When contributing a major change to this repository, please first discuss the change you wish to
4+
make via an [issue](contributing/ISSUES.md) or via
5+
[Slack in the #prometeo-pyrrha channel](https://callforcode.org/slack). Minor issues can simply be
6+
addressed by sending by a pull request.
57

6-
All [pull requests](contributing/PULL-REQUESTS.md) will require you to ensure the change is certified via the [Developer Certificate of Origin (DCO)](https://github.com/apps/dco/). The DCO is a lightweight way for contributors to certify that they wrote or otherwise have the right to submit the code they are contributing to the project.
8+
All [pull requests](contributing/PULL-REQUESTS.md) will require you to ensure the change is
9+
certified via the [Developer Certificate of Origin (DCO)](https://github.com/apps/dco/). The DCO is
10+
a lightweight way for contributors to certify that they wrote or otherwise have the right to submit
11+
the code they are contributing to the project.
712

8-
Please note we have a [Code of Conduct](#code-of-conduct), please follow it in all your interactions with the project and its community.
13+
Please note we have a [Code of Conduct](#code-of-conduct), please follow it in all your interactions
14+
with the project and its community.
915

1016
## Pull Request Process
1117

@@ -19,14 +25,14 @@ Please note we have a [Code of Conduct](#code-of-conduct), please follow it in a
1925

2026
### Our Pledge
2127

22-
In the interest of fostering an open and welcoming environment, we as
23-
contributors and maintainers pledge to making participation in our project and
24-
our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
28+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers
29+
pledge to making participation in our project and our community a harassment-free experience for
30+
everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level
31+
of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
2532

2633
### Our Standards
2734

28-
Examples of behavior that contributes to creating a positive environment
29-
include:
35+
Examples of behavior that contributes to creating a positive environment include:
3036

3137
- Using welcoming and inclusive language
3238
- Being respectful of differing viewpoints and experiences
@@ -36,50 +42,49 @@ include:
3642

3743
Examples of unacceptable behavior by participants include:
3844

39-
- The use of sexualized language or imagery and unwelcome sexual attention or
40-
advances
45+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
4146
- Trolling, insulting/derogatory comments, and personal or political attacks
4247
- Public or private harassment
43-
- Publishing others' private information, such as a physical or electronic
44-
address, without explicit permission
45-
- Other conduct which could reasonably be considered inappropriate in a
46-
professional setting
48+
- Publishing others' private information, such as a physical or electronic address, without explicit
49+
permission
50+
- Other conduct which could reasonably be considered inappropriate in a professional setting
4751

4852
### Our Responsibilities
4953

50-
Project maintainers are responsible for clarifying the standards of acceptable
51-
behavior and are expected to take appropriate and fair corrective action in
52-
response to any instances of unacceptable behavior.
54+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are
55+
expected to take appropriate and fair corrective action in response to any instances of unacceptable
56+
behavior.
5357

54-
Project maintainers have the right and responsibility to remove, edit, or
55-
reject comments, commits, code, wiki edits, issues, and other contributions
56-
that are not aligned to this Code of Conduct, or to ban temporarily or
57-
permanently any contributor for other behaviors that they deem inappropriate,
58+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits,
59+
code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or
60+
to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate,
5861
threatening, offensive, or harmful.
5962

6063
### Scope
6164

62-
This Code of Conduct applies both within project spaces and in public spaces
63-
when an individual is representing the project or its community. Examples of
64-
representing a project or community include using an official project e-mail
65-
address, posting via an official social media account, or acting as an appointed
66-
representative at an online or offline event. Representation of a project may be
65+
This Code of Conduct applies both within project spaces and in public spaces when an individual is
66+
representing the project or its community. Examples of representing a project or community include
67+
using an official project e-mail address, posting via an official social media account, or acting as
68+
an appointed representative at an online or offline event. Representation of a project may be
6769
further defined and clarified by project maintainers.
6870

6971
### Enforcement
7072

71-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
72-
reported by contacting the project team on [Slack in the #prometeo-pyrrha channel](https://callforcode.org/slack).
73+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting
74+
the project team on [Slack in the #prometeo-pyrrha channel](https://callforcode.org/slack).
7375

74-
All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident.Further details of specific enforcement policies may be posted separately.
76+
All complaints will be reviewed and investigated and will result in a response that is deemed
77+
necessary and appropriate to the circumstances. The project team is obligated to maintain
78+
confidentiality with regard to the reporter of an incident.Further details of specific enforcement
79+
policies may be posted separately.
7580

76-
Project maintainers who do not follow or enforce the Code of Conduct in good
77-
faith may face temporary or permanent repercussions as determined by other
78-
members of the project's leadership.
81+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face
82+
temporary or permanent repercussions as determined by other members of the project's leadership.
7983

8084
### Attribution
8185

82-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
86+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at
87+
[http://contributor-covenant.org/version/1/4][version]
8388

8489
[homepage]: http://contributor-covenant.org
8590
[version]: http://contributor-covenant.org/version/1/4/

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Pyrrha website - pyrrha-platform.org
22

3-
[![License](https://img.shields.io/badge/License-Apache2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0) [![Slack](https://img.shields.io/static/v1?label=Slack&message=%23prometeo-pyrrha&color=blue)](https://callforcode.org/slack)
3+
[![License](https://img.shields.io/badge/License-Apache2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
4+
[![Slack](https://img.shields.io/static/v1?label=Slack&message=%23prometeo-pyrrha&color=blue)](https://callforcode.org/slack)
45

56
This is the pyrrha-platform.org website code. It's based on the Carbon Design System and React.
67

@@ -27,7 +28,8 @@ You will also see any lint errors in the console.
2728
### `yarn test`
2829

2930
Launches the test runner in the interactive watch mode.\
30-
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
31+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests)
32+
for more information.
3133

3234
### `yarn build`
3335

@@ -39,11 +41,13 @@ Your app is ready to be deployed!
3941

4042
## Contributing
4143

42-
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting Pyrrha pull requests.
44+
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process
45+
for submitting Pyrrha pull requests.
4346

4447
### Submitting pull requests for the website
4548

46-
Please send pull requests against the `main` branch. Changes will then automatically be deployed to the `gh-pages` branch by a GitHub action.
49+
Please send pull requests against the `main` branch. Changes will then automatically be deployed to
50+
the `gh-pages` branch by a GitHub action.
4751

4852
## License
4953

eslint.config.js

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
// Shared ESLint configuration for all Pyrrha JavaScript/React projects
2+
import js from '@eslint/js';
3+
import globals from 'globals';
4+
import prettier from 'eslint-config-prettier';
5+
import react from 'eslint-plugin-react';
6+
import reactHooks from 'eslint-plugin-react-hooks';
7+
import jest from 'eslint-plugin-jest';
8+
import testingLibrary from 'eslint-plugin-testing-library';
9+
import jestDom from 'eslint-plugin-jest-dom';
10+
11+
export default [
12+
js.configs.recommended,
13+
prettier,
14+
15+
{
16+
ignores: [
17+
'**/node_modules/**',
18+
'**/build/**',
19+
'**/dist/**',
20+
'**/coverage/**',
21+
'**/venv/**',
22+
'**/.git/**',
23+
],
24+
languageOptions: {
25+
ecmaVersion: 'latest',
26+
sourceType: 'module',
27+
},
28+
rules: {
29+
// Core JavaScript rules
30+
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
31+
'no-console': 'off', // Allow console for server-side logging
32+
'prefer-const': 'error',
33+
eqeqeq: 'error',
34+
'no-var': 'error',
35+
'no-duplicate-imports': 'error',
36+
'no-unreachable': 'error',
37+
},
38+
},
39+
40+
// CommonJS files (require/module.exports)
41+
{
42+
files: ['**/*.cjs', '**/check-workspace.js'],
43+
languageOptions: {
44+
ecmaVersion: 'latest',
45+
sourceType: 'commonjs',
46+
globals: { ...globals.node },
47+
},
48+
rules: {
49+
'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
50+
'no-console': 'off',
51+
'prefer-const': 'error',
52+
},
53+
},
54+
55+
// Node.js server files (API backends, MQTT client, WebSocket server)
56+
{
57+
files: [
58+
'**/server.js',
59+
'**/api.py', // Flask entry points
60+
'**/mqttclient.js',
61+
'**/logger.js',
62+
'api-auth/**/*.js',
63+
'api-main/**/*.py',
64+
],
65+
languageOptions: {
66+
globals: { ...globals.node },
67+
},
68+
rules: {
69+
'no-process-exit': 'warn',
70+
},
71+
},
72+
73+
// React frontend files
74+
{
75+
files: ['src/**/*.{js,jsx,ts,tsx}'],
76+
plugins: {
77+
react,
78+
'react-hooks': reactHooks,
79+
},
80+
languageOptions: {
81+
globals: { ...globals.browser },
82+
parserOptions: { ecmaFeatures: { jsx: true } },
83+
},
84+
settings: {
85+
react: { version: 'detect' },
86+
},
87+
rules: {
88+
...react.configs.recommended.rules,
89+
...reactHooks.configs.recommended.rules,
90+
'react/react-in-jsx-scope': 'off',
91+
'react/prop-types': 'warn',
92+
},
93+
},
94+
95+
// Test files
96+
{
97+
files: [
98+
'**/__tests__/**/*.{js,jsx,ts,tsx}',
99+
'**/*.{test,spec}.{js,jsx,ts,tsx}',
100+
'**/test/**/*.js',
101+
],
102+
plugins: {
103+
jest,
104+
'testing-library': testingLibrary,
105+
'jest-dom': jestDom,
106+
},
107+
languageOptions: {
108+
globals: { ...globals.jest, ...globals.browser },
109+
},
110+
rules: {
111+
...jest.configs.recommended.rules,
112+
...testingLibrary.configs['react'].rules,
113+
...jestDom.configs.recommended.rules,
114+
},
115+
},
116+
];

0 commit comments

Comments
 (0)