Skip to content

Commit

Permalink
fix linting issues (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
vnys authored Dec 13, 2019
1 parent d8edbb9 commit 8b1a985
Show file tree
Hide file tree
Showing 24 changed files with 598 additions and 124 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/apps/**
/libraries/icons/**
node_modules
3 changes: 3 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ rules:
no-unused-vars:
- error
- varsIgnorePattern: ^React$
# Named exports are better
import/no-default-export:
- error
# Not everything needs a default export, for example utils files
import/prefer-default-export:
- off
Expand Down
1 change: 1 addition & 0 deletions apps/figma-broker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ async function createTokens(ctx) {
export const tokens = {
${tokens.map((token) => token.name).join(',\n')}
}
`
writeFile(
PATHS.BASE_TOKENS,
Expand Down
7 changes: 3 additions & 4 deletions libraries/core-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"url": "https://github.com/equinor/design-system"
},
"scripts": {
"lint": "eslint ./src/**/*.{jsx,js}",
"build": "rollup -c",
"dev": "rollup -c -w",
"test": "jest",
Expand All @@ -30,18 +29,18 @@
"devDependencies": {
"@babel/cli": "^7.7.5",
"@babel/core": "^7.7.5",
"@babel/preset-env": "^7.7.5",
"@babel/preset-env": "^7.7.6",
"@babel/preset-react": "^7.7.4",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/react": "^9.3.3",
"babel-plugin-styled-components": "^1.10.6",
"jest": "^24.9.0",
"jest-styled-components": "^6.3.4",
"prettier": "^1.19.1",
"prop-types": "^15.7.2",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"rollup": "^1.27.8",
"rollup": "^1.27.11",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-commonjs": "^9.3.4",
"rollup-plugin-json": "^4.0.0",
Expand Down
75 changes: 38 additions & 37 deletions libraries/core-react/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 16 additions & 11 deletions libraries/core-react/pnpmfile.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
module.exports = {
hooks: {
readPackage,
},
}

function readPackage(pkg, context) {
const additionalDependencies = {}

if (pkg.name === 'enzyme-adapter-react-16') {
pkg.dependencies = {
...pkg.dependencies,
has: '^1.0.3',
}
additionalDependencies.has = '^1.0.3'
context.log('Added missing dependencies for enzyme-adapter-react-16')
}

return pkg
return {
...pkg,
dependencies: {
...pkg.dependencies,
...additionalDependencies,
},
}
}

module.exports = {
hooks: {
readPackage,
},
}
1 change: 1 addition & 0 deletions libraries/core-react/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable import/no-default-export */
import resolve from 'rollup-plugin-node-resolve'
import commonjs from 'rollup-plugin-commonjs'
import json from 'rollup-plugin-json'
Expand Down
1 change: 1 addition & 0 deletions libraries/core-react/rtl.setup.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/* eslint-disable import/no-extraneous-dependencies */
import '@testing-library/jest-dom/extend-expect'
6 changes: 2 additions & 4 deletions libraries/core-react/src/Button/Button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import primaryButtonTokens from '@equinor/eds-tokens/components/button/buttons-p
import secondaryButtonTokens from '@equinor/eds-tokens/components/button/buttons-secondary.json'
import dangerButtonTokens from '@equinor/eds-tokens/components/button/buttons-danger.json'
import disabledButtonTokens from '@equinor/eds-tokens/components/button/buttons-disabled.json'
import { typographyTemplate } from './../_common/templates'
import { typographyTemplate } from '../_common/templates'

const colors = {
primary: primaryButtonTokens,
Expand Down Expand Up @@ -96,7 +96,7 @@ const ButtonBase = styled.button.attrs(() => ({
// - Use ThemeProvider
// - Set attr on button

const Button = ({
export const Button = ({
variant,
children,
disabled,
Expand Down Expand Up @@ -146,5 +146,3 @@ Button.defaultProps = {
}

Button.displayName = 'eds-button'

export default Button
2 changes: 1 addition & 1 deletion libraries/core-react/src/Button/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from './Button'
export { Button } from './Button'
Loading

0 comments on commit 8b1a985

Please sign in to comment.