diff --git a/.clabot b/.clabot index 7526e4d1..e7c18aa2 100644 --- a/.clabot +++ b/.clabot @@ -1,4 +1,4 @@ { - "contributors": ["azukaar", "jwr1", "Jogai", "InterN0te", "catmandx", "revam", "Kawanaao", "davis4acca", "george-radu-cs"], + "contributors": ["azukaar", "jwr1", "Jogai", "InterN0te", "catmandx", "revam", "Kawanaao", "davis4acca", "george-radu-cs", "Malo-LC"], "message": "We require contributors to sign our [Contributor License Agreement](https://github.com/azukaar/Cosmos-Server/blob/master/cla.md). In order for us to review and merge your code, add yourself to the .clabot file as contributor, as a way of signing the CLA." } diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..9b92813c --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,35 @@ +module.exports = { + plugins: ['prettier', 'react', 'jsx-a11y', 'react-hooks', 'import', 'flowtype'], + extends: [ + 'eslint:recommended', + 'plugin:react/recommended', + 'plugin:prettier/recommended', + 'plugin:jsx-a11y/recommended' + ], + parserOptions: { + ecmaVersion: 2020, + sourceType: 'module', + ecmaFeatures: { + jsx: true + } + }, + settings: { + react: { + version: 'detect' + } + }, + env: { + browser: true, + node: true, + es2020: true + }, + rules: { + 'prettier/prettier': [ + 'warn', + { + endOfLine: 'auto' + } + ], + eqeqeq: ['error', 'smart'] + } +}; diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..abbd2e3c --- /dev/null +++ b/.prettierignore @@ -0,0 +1,5 @@ +node_modules +dist +build +coverage +**/*.log diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..0e23d948 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,13 @@ +{ + "printWidth": 120, + "tabWidth": 2, + "useTabs": false, + "semi": true, + "singleQuote": true, + "trailingComma": "none", + "bracketSpacing": true, + "arrowParens": "always", + "proseWrap": "preserve", + "bracketSameLine": true, + "endOfLine": "auto" +} diff --git a/package-lock.json b/package-lock.json index 31202b90..7d969d89 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "cosmos-server", - "version": "0.15.0-unstable19", + "version": "0.15.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "cosmos-server", - "version": "0.15.0-unstable19", + "version": "0.15.6", "dependencies": { "@ant-design/colors": "^6.0.0", "@ant-design/icons": "^4.7.0", diff --git a/package.json b/package.json index 08c80ebd..4a33089f 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,10 @@ "dockerdevrun": "docker stop cosmos-dev; docker rm cosmos-dev; docker run --cap-add NET_ADMIN -d -p 7200:443 -p 80:80 -p 53:53 -p 443:443 -p 4242:4242/udp -e DOCKER_HOST=tcp://host.docker.internal:2375 -e COSMOS_MONGODB=$MONGODB -e COSMOS_LOG_LEVEL=DEBUG -v /:/mnt/host --restart=unless-stopped -h cosmos-dev --name cosmos-dev cosmos-dev", "dockerdev": "npm run client-build && npm run dockerdevbuild && npm run dockerdevrun", "demo-build": "vite build --base=/cosmos-ui/ --mode demo", - "demo": "vite --mode demo" + "demo": "vite --mode demo", + "lint": "eslint --ext .js,.jsx,.ts,.tsx client", + "lint-fix": "eslint --fix --ext .js,.jsx,.ts,.tsx client", + "format": "prettier --write \"client/**/*.{js,jsx,ts,tsx}\"" }, "eslintConfig": { "extends": [