Skip to content

Commit

Permalink
Updates to frontend
Browse files Browse the repository at this point in the history
This started with just adding more eslint rules and cleaning up undefined variables
* Removed localstorage and moved to a state object inside of Root App
* Added redirect for initial landing page
* Replaced a few components with functional components (mostly because
        component did mount wasn't firing)
* Worked towards a single shared card layout screen (Only plugin is
        using it so far)
  • Loading branch information
halkeye committed Sep 26, 2020
1 parent 2263206 commit 44a8818
Show file tree
Hide file tree
Showing 25 changed files with 3,183 additions and 1,482 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ build/

### VS Code ###
.vscode/
public/
tmp/
5 changes: 3 additions & 2 deletions frontend/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
REACT_APP_GITHUB_COMMUNITY_URL=https://api.github.com/repos/sladyn98/custom-distribution-service-community-configurations/contents/configurations
REACT_APP_API_URL=/
REACT_APP_GITHUB_COMMUNITY_REPO=halkeye/custom-distribution-service-community-configurations
REACT_APP_API_URL=/
#DEV_API_SERVER_PROXY=https://customize.jenkins-infra.g4v.dev/
1 change: 1 addition & 0 deletions frontend/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!.eslintrc.js
71 changes: 47 additions & 24 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,49 @@
module.exports = {
"env": {
"browser": true,
"es6": true
},
"extends": ["eslint:recommended", "react-app", "plugin:jsx-a11y/recommended"],
"plugins": ["import","jsx-a11y"],
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"rules": {
"no-console": "warn",
"no-eval": "error",
"import/first": "error"
},
"overrides": [
{
"files": ["__tests__/**/*.js(x)?"],
"plugins": ["jest"],
"env": {
"jest": true
}
}
]
extends: [
'react-app',
'eslint:recommended',
'plugin:react/recommended',
'plugin:jsx-a11y/recommended',
],
overrides: [
{
env: {
jest: true
},
files: ['__tests__/**/*.js(x)?'],
plugins: ['jest'],
}
],
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module'
},
plugins: [
'import',
'jsx-a11y',
'react',
'eslint-plugin-no-inline-styles'
],
rules: {
'array-callback-return': 'error',
eqeqeq: 'error',
'import/first': 'error',
indent: ['error', 4],
'keyword-spacing': ['error', { after: true, before: true }],
'no-console': 'warn',
'no-eval': 'error',
// 'no-inline-styles/no-inline-styles': ['error'],
'no-new-object': 'error',
'no-unused-vars': 'error',
'no-var': ['error'],
'prefer-template': ['error'],
'quote-props': ['error', 'as-needed'],
quotes: ['error', 'single'],
'react/jsx-curly-spacing': ['error', {allowMultiline: true, when: 'always'}],
'react/jsx-equals-spacing': ['error', 'never'],
'react/no-unknown-property': ['error'],
semi: ['error', 'never'],
// 'sort-keys': ['error', 'asc', {caseSensitive: true, minKeys: 2, natural: false}],
},

}
19 changes: 19 additions & 0 deletions frontend/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": "stylelint-config-standard",
"plugins": ["stylelint-a11y"],
"rules": {
"a11y/media-prefers-reduced-motion": [true, { "severity": "warning" }],
"a11y/no-outline-none": true,
"a11y/selector-pseudo-class-focus": true,
"a11y/content-property-no-static-value": [true, { "severity": "warning" }],
"a11y/font-size-is-readable": [true, { "severity": "warning" }],
"a11y/line-height-is-vertical-rhythmed": [true, { "severity": "warning" }],
"a11y/no-display-none": [true, { "severity": "warning" }],
"a11y/no-spread-text": [true, { "severity": "warning" }],
"a11y/no-obsolete-attribute": [true, { "severity": "warning" }],
"a11y/no-obsolete-element": [true, { "severity": "warning" }],
"a11y/no-text-align-justify": [true, { "severity": "warning" }],
"a11y/media-prefers-color-scheme": [true, { "severity": "warning" }],
"indentation": 4
}
}
28 changes: 28 additions & 0 deletions frontend/config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// config-overrides.js

const StylelintPlugin = require('stylelint-webpack-plugin')

module.exports = {
webpack: function (config, env) {
if (env === 'development') {
config.plugins.push(
new StylelintPlugin({
// options here
})
)
}

return config
}
// jest: function(config) {
// // customize jest here
// return config;
// },
// devServer: function(configFunction) {
// return function(proxy, host) {
// // customize devServer config here
// return config;
// }
// }
}

Loading

0 comments on commit 44a8818

Please sign in to comment.