Skip to content
Closed
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
28 changes: 28 additions & 0 deletions .editorconfig
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To manage formatting on files

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
insert_final_newline = false

[*.{yml,yaml}]
indent_size = 2

[*.{ts,js,jsx,tsx}]
quote_type = double
continuation_indent_size = 2
curly_brace_next_line = false
indent_brace_style = BSD
spaces_around_operators = true
spaces_around_brackets = true

[*.{pl,pm,t,PL}]
max_line_length = off
continuation_indent_size = 4
11 changes: 0 additions & 11 deletions .eslintignore
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deprecated

This file was deleted.

46 changes: 0 additions & 46 deletions .eslintrc.js
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deprecated

This file was deleted.

32 changes: 32 additions & 0 deletions eslint.config.mjs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mirrors most of the configuration from the .eslintrc.js (and .eslintignore) but with a few added rules and items to attempt to help in maintaining the current codebase.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import js from "@eslint/js";
import globals from "globals";
import tseslint from "typescript-eslint";
import pluginReact from "eslint-plugin-react";
import css from "@eslint/css";
import { defineConfig } from "eslint/config";
import stylistic from "@stylistic/eslint-plugin";

export default defineConfig([
{ settings: { react: { version: "detect" } } },
{ ignores: ["*.cjs", "eslint.config.mjs", "**/public/**", "**/node_modules/**", "**/cypress/**", "cypress.config.ts", ".stylelintrc.js", "src/frontend/testing/**", "src/frontend/css/stylesheets/external/**", "src/frontend/components/dashboard/lib/react/polyfills/**", "babel.config.js", "webpack.config.js", "jest.config.js", "tsconfig.json", "src/frontend/js/lib/jqplot/**", "src/frontend/js/lib/jquery/**", "src/frontend/js/lib/plotly/**", "src/frontend/components/timeline/**", "fengari-web.js"] },
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"], plugins: { js }, extends: ["js/recommended"] },
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"], languageOptions: { globals: { ...globals.browser, ...globals.jquery } } },
tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
{ files: ["**/*.css"], plugins: { css }, language: "css/css", extends: ["css/recommended"] },
{ plugins: {'@stylistic': stylistic} },
{
rules: {
"@typescript-eslint/no-explicit-any": "off",
'react/prop-types': 'off',
'react/no-deprecated': 'off', // We are currently using deprecated React features, so we disable this rule - this will change in the future
'@stylistic/quotes': ['error', 'single'],
'@stylistic/no-extra-semi': 'error',
'@stylistic/semi': ['error', 'always'],
'@stylistic/curly-newline': 'error',
'@stylistic/newline-per-chained-call': 'error',
'@stylistic/indent': ['error', 4],
'@stylistic/comma-dangle': ['error', 'never']
}
}
]);
Loading