mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
* Add custom jest resolver to fix requiring "uuid" module Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Update dependencies Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Introduce test utils for rendering and running with thrown mobx reactions Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Extract startable-stoppable to NPM package Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Extract messaging to NPM package Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Switch to using startable-stoppable from NPM package Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Switch to using messaging from the Feature Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Remove old implementation of messaging Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Make setupping app paths happen earlier in renderer Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Fix typo Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Add kludge to make testing-library work properly from test-utils package Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Fix code style Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Add lint:fix -root script Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Fix unrelated failing unit tests Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Turn of no-floating-promises from typescript linting for being broken Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Make linting not happen for dist -directories Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Make linting failures appear as failure Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Stop running prettier twice It already gets ran as eslint-plugin. Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Make CI run unit tests for all packages by consolidating name of NPM script Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Add missing unit tests for coverage Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Skip coverage for test utils Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Remove check for coverage in packages which are not ready for it Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Stop collecting coverage from index.ts files them being indirections to the implementation Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Implement sending message to channel in main Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Add missing feature dependencies Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Add dummy implementations for requesting in main from renderer Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Re-enable communicating from main to cluster frames Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Ignore trivial files from coverage Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Update package-lock Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Extract message-bridge to separate NPM package to prevent dev dependencies being in the production bundle Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Extract computed channel to own NPM package for clear dependencies Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Consolidate electron related stuff to a directory Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Add missing publish configurations Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> * Ignore test implementation from coverage being not interesting Signed-off-by: Janne Savolainen <janne.savolainen@live.fi> --------- Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
175 lines
5.1 KiB
JavaScript
175 lines
5.1 KiB
JavaScript
module.exports = {
|
|
extends: [
|
|
"plugin:@typescript-eslint/recommended",
|
|
"react-app",
|
|
"react-app/jest",
|
|
"airbnb-typescript",
|
|
"prettier",
|
|
"plugin:security/recommended",
|
|
"plugin:xss/recommended",
|
|
"plugin:no-unsanitized/DOM"
|
|
],
|
|
plugins: [
|
|
"unused-imports",
|
|
"prettier",
|
|
"xss",
|
|
"no-unsanitized"
|
|
],
|
|
ignorePatterns: ["dist/*"],
|
|
rules: {
|
|
"react/react-in-jsx-scope": 0,
|
|
"security/detect-object-injection": "off",
|
|
"security/detect-non-literal-fs-filename": "off"
|
|
},
|
|
overrides: [
|
|
{
|
|
files: [
|
|
"**/*.ts?(x)",
|
|
"**/*.js?(x)",
|
|
"**/*.@(m|c)js"
|
|
],
|
|
rules: {
|
|
"prettier/prettier": 2,
|
|
indent: "off", // Let prettier do it
|
|
curly: "error",
|
|
"import/prefer-default-export": "off",
|
|
"class-methods-use-this": "off",
|
|
"comma-dangle": "off",
|
|
"max-classes-per-file": "off",
|
|
"no-shadow": "off",
|
|
"no-param-reassign": ["error", { props: false }],
|
|
quotes: [
|
|
"error",
|
|
"double",
|
|
{
|
|
"avoidEscape": true,
|
|
"allowTemplateLiterals": true
|
|
}
|
|
],
|
|
"padding-line-between-statements": [
|
|
"error",
|
|
{
|
|
blankLine: "always",
|
|
prev: "*",
|
|
next: "return",
|
|
},
|
|
{
|
|
blankLine: "always",
|
|
prev: "*",
|
|
next: "block-like",
|
|
},
|
|
{
|
|
blankLine: "always",
|
|
prev: "*",
|
|
next: "function",
|
|
},
|
|
{
|
|
blankLine: "always",
|
|
prev: "*",
|
|
next: "class",
|
|
},
|
|
{
|
|
blankLine: "always",
|
|
prev: ["const", "let", "var"],
|
|
next: "*",
|
|
},
|
|
{
|
|
blankLine: "any",
|
|
prev: ["const", "let", "var"],
|
|
next: ["const", "let", "var"],
|
|
},
|
|
],
|
|
"import/no-extraneous-dependencies": "off",
|
|
"jsx-a11y/no-redundant-roles": ["off"],
|
|
"no-restricted-syntax": [
|
|
"error",
|
|
{
|
|
selector: "ForInStatement",
|
|
message:
|
|
"for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.",
|
|
},
|
|
{
|
|
selector: "WithStatement",
|
|
message:
|
|
"`with` is disallowed in strict mode because it makes code impossible to predict and optimize.",
|
|
},
|
|
],
|
|
"max-len": [
|
|
"error",
|
|
120,
|
|
2,
|
|
{
|
|
ignoreUrls: true,
|
|
ignoreComments: false,
|
|
ignoreRegExpLiterals: true,
|
|
ignoreStrings: true,
|
|
ignoreTemplateLiterals: true,
|
|
},
|
|
],
|
|
"unused-imports/no-unused-imports-ts": "error",
|
|
"import/extensions": "off",
|
|
"linebreak-style": ["error", "unix"],
|
|
"eol-last": ["error", "always"],
|
|
"object-shorthand": "error",
|
|
"prefer-template": "error",
|
|
"template-curly-spacing": "error",
|
|
"keyword-spacing": "off",
|
|
|
|
// testing-library
|
|
"testing-library/no-node-access": "off",
|
|
"testing-library/no-container": "off",
|
|
"testing-library/prefer-screen-queries": "off",
|
|
"testing-library/no-render-in-setup": "off",
|
|
"testing-library/render-result-naming-convention": "off",
|
|
|
|
// Typescript specific rules
|
|
"@typescript-eslint/ban-types": "off",
|
|
"@typescript-eslint/ban-ts-comment": "off",
|
|
"@typescript-eslint/no-empty-interface": "off",
|
|
"@typescript-eslint/no-floating-promises": "off",
|
|
"@typescript-eslint/interface-name-prefix": "off",
|
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
"@typescript-eslint/no-explicit-any": "off",
|
|
"@typescript-eslint/no-useless-constructor": "off",
|
|
"@typescript-eslint/comma-dangle": "off",
|
|
"@typescript-eslint/no-shadow": "off",
|
|
"@typescript-eslint/quotes": [
|
|
"error",
|
|
"double",
|
|
{
|
|
avoidEscape: true,
|
|
allowTemplateLiterals: true,
|
|
},
|
|
],
|
|
"@typescript-eslint/no-unused-expressions": [
|
|
"error",
|
|
{
|
|
allowShortCircuit: true,
|
|
},
|
|
],
|
|
"@typescript-eslint/no-unused-vars": "off",
|
|
"@typescript-eslint/keyword-spacing": ["error"],
|
|
"@typescript-eslint/naming-convention": "off",
|
|
|
|
// React specific rules
|
|
"react-hooks/rules-of-hooks": "error",
|
|
"react-hooks/exhaustive-deps": "warn",
|
|
"react/require-default-props": "off",
|
|
"react/function-component-definition": "off",
|
|
"react/prop-types": "off",
|
|
"react/jsx-filename-extension": [1, { extensions: [".tsx"] }],
|
|
|
|
// jsx-a11y custom components
|
|
"jsx-a11y/label-has-associated-control": [
|
|
2,
|
|
{
|
|
controlComponents: ["Select", "StyledInput", "StyledSlider"],
|
|
depth: 1,
|
|
},
|
|
],
|
|
},
|
|
},
|
|
],
|
|
};
|