mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 04:51:51 +00:00
Merge pull request #3 from prowler-cloud/PRWLR-4039-Frontend-Build-pipeline-for-UI-repo
Build pipeline
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
module.exports = {
|
||||
env: {
|
||||
node: true,
|
||||
es2021: true,
|
||||
},
|
||||
parser: "@typescript-eslint/parser",
|
||||
plugins: ["prettier", "@typescript-eslint", "simple-import-sort"],
|
||||
extends: [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/eslint-recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"prettier",
|
||||
],
|
||||
parserOptions: {
|
||||
ecmaVersion: "latest",
|
||||
sourceType: "module",
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
},
|
||||
rules: {
|
||||
"no-console": 1,
|
||||
eqeqeq: 2,
|
||||
// indent: ["error", 2, { SwitchCase: 1 }], // disabled because it clashes with prettier's indent
|
||||
quotes: ["error", "double", "avoid-escape"],
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"prettier/prettier": [
|
||||
"error",
|
||||
{
|
||||
endOfLine: "auto",
|
||||
tabWidth: 2,
|
||||
useTabs: false,
|
||||
},
|
||||
],
|
||||
"eol-last": ["error", "always"],
|
||||
"simple-import-sort/imports": "error",
|
||||
"simple-import-sort/exports": "error",
|
||||
},
|
||||
};
|
||||
-122
@@ -1,122 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/eslintrc.json",
|
||||
"env": {
|
||||
"browser": false,
|
||||
"es2021": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": [
|
||||
"plugin:react/recommended",
|
||||
"plugin:prettier/recommended",
|
||||
"plugin:react-hooks/recommended",
|
||||
"plugin:jsx-a11y/recommended",
|
||||
"next",
|
||||
"prettier"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
},
|
||||
"ecmaVersion": 12,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
"react",
|
||||
"unused-imports",
|
||||
"import",
|
||||
"@typescript-eslint",
|
||||
"jsx-a11y",
|
||||
"prettier"
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"warn",
|
||||
{
|
||||
"args": "after-used",
|
||||
"argsIgnorePattern": "^_.*?$",
|
||||
"ignoreRestSiblings": false
|
||||
}
|
||||
],
|
||||
"import/order": [
|
||||
"warn",
|
||||
{
|
||||
"groups": [
|
||||
"type",
|
||||
"builtin",
|
||||
"object",
|
||||
"external",
|
||||
"internal",
|
||||
"parent",
|
||||
"sibling",
|
||||
"index"
|
||||
],
|
||||
"newlines-between": "always",
|
||||
"pathGroups": [
|
||||
{
|
||||
"group": "external",
|
||||
"pattern": "~/**",
|
||||
"position": "after"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"jsx-a11y/click-events-have-key-events": "warn",
|
||||
"jsx-a11y/interactive-supports-focus": "warn",
|
||||
"no-console": "warn",
|
||||
"no-unused-vars": "off",
|
||||
"padding-line-between-statements": [
|
||||
"warn",
|
||||
{
|
||||
"blankLine": "always",
|
||||
"next": "return",
|
||||
"prev": "*"
|
||||
},
|
||||
{
|
||||
"blankLine": "always",
|
||||
"next": "*",
|
||||
"prev": [
|
||||
"const",
|
||||
"let",
|
||||
"var"
|
||||
]
|
||||
},
|
||||
{
|
||||
"blankLine": "any",
|
||||
"next": [
|
||||
"const",
|
||||
"let",
|
||||
"var"
|
||||
],
|
||||
"prev": [
|
||||
"const",
|
||||
"let",
|
||||
"var"
|
||||
]
|
||||
}
|
||||
],
|
||||
"prettier/prettier": "warn",
|
||||
"react-hooks/exhaustive-deps": "off",
|
||||
"react/jsx-sort-props": [
|
||||
"warn",
|
||||
{
|
||||
"callbacksLast": true,
|
||||
"noSortAlphabetically": true,
|
||||
"reservedFirst": true,
|
||||
"shorthandFirst": true
|
||||
}
|
||||
],
|
||||
"react/jsx-uses-react": "off",
|
||||
"react/no-unescaped-entities": "off",
|
||||
"react/prop-types": "off",
|
||||
"react/react-in-jsx-scope": "off",
|
||||
"react/self-closing-comp": "warn",
|
||||
"unused-imports/no-unused-imports": "warn",
|
||||
"unused-imports/no-unused-vars": "off"
|
||||
},
|
||||
"settings": {
|
||||
"react": {
|
||||
"version": "detect"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
name: CI - Code Quality and Health Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
test-and-coverage:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node-version: [20.x]
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Setup Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
- name: Run Healthcheck
|
||||
run: npm healthcheck
|
||||
@@ -0,0 +1 @@
|
||||
node_modules/
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"bracketSpacing": true,
|
||||
"singleQuote": false,
|
||||
"trailingComma": "all",
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"semi": true,
|
||||
"printWidth": 120
|
||||
}
|
||||
+11
-5
@@ -35,15 +35,21 @@
|
||||
"typescript": "5.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint-config-prettier": "^9.1.0"
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-simple-import-sort": "^12.1.1"
|
||||
},
|
||||
"name": "next-app-template",
|
||||
"name": "prowler-next-app",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "next build",
|
||||
"dev": "next dev",
|
||||
"lint": "eslint . --ext .ts,.tsx -c .eslintrc.json --fix",
|
||||
"start": "next start"
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"typecheck": "tsc",
|
||||
"healthcheck": "npm run typecheck && npm run lint:check",
|
||||
"lint:check": "./node_modules/.bin/eslint ./app",
|
||||
"lint:fix": "eslint . --ext .ts,.tsx -c .eslintrc.cjs --fix",
|
||||
"format:check": "./node_modules/.bin/prettier --check ./app",
|
||||
"format:write": "./node_modules/.bin/prettier --config .prettierrc.json --write ./app"
|
||||
},
|
||||
"version": "0.0.1"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user