Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ux 431 static testing #34

Merged
merged 12 commits into from
Feb 12, 2019
37 changes: 37 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"env": {
"es6": true,
"browser": true,
"jest": true,
Copy link
Contributor

Choose a reason for hiding this comment

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

It'd be nice to restrict jest and cypress to just the files they're relevant for. Can be done later

"cypress/globals": true
},
"extends": ["airbnb", "prettier"],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 7,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"experimentalObjectRestSpread": true
}
},
"plugins": ["cypress"],
"rules": {
"camelcase": "off",
"class-methods-use-this": "off",
"consistent-return": "off",
"import/no-extraneous-dependencies": "off",
"import/no-unresolved": "off",
"import/prefer-default-export": "off",
"jsx-a11y/href-no-hash": "off",
"jsx-a11y/label-has-for": "off",
"new-cap": "off",
"no-plusplus": "off",
"no-underscore-dangle": "off",
"prefer-destructuring": "off",
"react/destructuring-assignment": "off",
"react/jsx-filename-extension": [1, { "extensions": [".js"] }],
"react/jsx-one-expression-per-line": "off",
"react/prefer-stateless-function": "off"
}
}
11 changes: 11 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### 🛠 Purpose

---

### ✏️ Notes to Reviewer

---

### 🖥 Screenshots

---
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v10.0.0
Copy link
Contributor

@alexzherdev alexzherdev Feb 12, 2019

Choose a reason for hiding this comment

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

I think the v should be omitted but will probably work as is. Also I'll try to find a way not to force an exact version (i.e. if I already have 10.15 installed, ideally nvm use would just use that)

Not blocking now.

ETA: found it. You can just say 10 and it will match any 10.x version you already have installed (it will pick the latest)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

executing node -v > .nvmrc, they added the v automatically, maybe does not need it but best practices. no sure...

6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Git
.git
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm according to my reading this is indeed necessary, but none of our other modules are ignoring those folders...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think none of our other modules are actually running prettier and using --list-different flag to note are fail our buildings, so I guess we should use this one.

.github

#Node modules
node_modules
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
useTabs: false
tabWidth: 2
printWidth: 120
trailingComma: es5
semi: true
2 changes: 1 addition & 1 deletion .storybook/assets/css/storybook.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "~tokens/tokens.scss";

.story-body {
padding: $space*2;
padding: $space * 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

cc @mikrotron 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

:suspect:

}
14 changes: 7 additions & 7 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ module.exports = {
{
test: /\.js$/,
loaders: ["babel-loader?cacheDirectory"],
exclude: /node_modules/
exclude: /node_modules/,
},
{
test: /\.scss$/,
loaders: ["style-loader", "css-loader", "sass-loader"],
include: path.resolve(__dirname, "../")
}
]
include: path.resolve(__dirname, "../"),
},
],
},
resolve: {
alias: {
tokens: path.resolve("./packages/Tokens/"),
storybook: path.resolve("./.storybook/")
}
}
storybook: path.resolve("./.storybook/"),
},
},
};
2 changes: 2 additions & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--install.audit true
--add.audit true
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,17 @@ $ yarn storybook
## run test

To be implemented [#19](https://github.com/acl-services/paprika/issues/19)

## minimum requirements

### yarn version

yarn v1.12.3 (which contains yarn audit command) or update via:

```sh
$ brew install yarn
```

### node version

v10.0.0 which is required by `eslint`
21 changes: 16 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@
"storybook": "start-storybook -p 9009 -c .storybook",
"storybook:build": "build-storybook -c .storybook -o storybook-dist",
"test": "yarn test:a11y",
"test:a11y": "NODE_PATH=. jest --config .jest-a11y.config.json"
"test:a11y": "NODE_PATH=. jest --config .jest-a11y.config.json",
"lint": "eslint packages",
"lint:fix": "yarn lint --fix",
"prettier:format": "yarn prettier -- --write",
"prettier": "prettier \"**/*.+(js|json|yml|css|scss|md|mdx)\"",
"prepush": "yarn lint && yarn test && yarn test:a11y && yarn prettier -- --list-different"
},
"engines": {
"yarn": ">=1.12.3"
},
"private": true,
"workspaces": [
Expand All @@ -33,19 +41,22 @@
"babel-plugin-transform-runtime": "^6.23.0",
"css-loader": "^1.0.0",
"cypress": "^3.1.0",
"eslint": "^5.3.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-config-prettier": "^3.0.1",
"eslint-config-prettier": "^4.0.0",
"eslint-plugin-cypress": "^2.2.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.1",
"eslint-plugin-react": "^7.11.1",
"eslint": "^5.3.0",
"jest-cli": "^20.0.4",
"husky": "^1.3.1",
"jest": "^20.0.4",
"jest-cli": "^20.0.4",
"lerna": "^3.0.5",
"pa11y": "^5.0.4",
"prettier": "^1.16.3",
"react": "16.3.2",
"react-axe": "^3.0.1",
"react-dom": "16.3.3",
"react": "16.3.2",
"sass-loader": "^4.0.2",
"sinon": "^6.1.4",
"style-loader": "^0.21.0",
Expand Down
Loading