Skip to content

Commit

Permalink
Merge pull request #78 from vtex-apps/add-eslint
Browse files Browse the repository at this point in the history
Add eslint
  • Loading branch information
Gustavo Monteiro Alves authored May 17, 2019
2 parents 1af4e93 + e1c8e8c commit 99c5d73
Show file tree
Hide file tree
Showing 10 changed files with 711 additions and 19 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,5 @@ docs/_book/
npm-debug.log
.build/
lib
.eslintrc
yarn-error.log
.vscode
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "es5"
"trailingComma": "es5",
"eslintIntegration": true
}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [2.13.0] - 2019-05-17

### Added

- `eslint` configuration.

## [2.12.0] - 2019-04-24
### Changed
- Scope messages by domain
Expand Down
5 changes: 5 additions & 0 deletions lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

cd react/
yarn
yarn lint
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"vendor": "vtex",
"name": "category-menu",
"version": "2.12.0",
"version": "2.13.0",
"title": "Category Menu",
"description": "Displays the categories for the store in a menu",
"defaultLocale": "pt-BR",
Expand Down
9 changes: 9 additions & 0 deletions react/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "vtex-react",
"env": {
"browser": true,
"es6": true,
"jest": true
}
}

4 changes: 3 additions & 1 deletion react/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ class CategoryMenu extends Component {
>
<SideBar
visible={sideBarVisible}
title={intl.formatMessage({ id: 'store/category-menu.departments.title' })}
title={intl.formatMessage({
id: 'store/category-menu.departments.title',
})}
departments={this.departments}
onClose={this.handleSidebarToggle}
showSubcategories={showSubcategories}
Expand Down
9 changes: 7 additions & 2 deletions react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"version": "0.0.0",
"scripts": {
"pretest": "yarn",
"test": "vtex-test-tools test"
"test": "vtex-test-tools test",
"lint": "eslint --ext js,jsx,ts,tsx ."
},
"dependencies": {
"classnames": "^2.2.6",
Expand All @@ -15,7 +16,11 @@
},
"devDependencies": {
"@vtex/test-tools": "^0.1.2",
"apollo-client": "^2.5.1"
"apollo-client": "^2.5.1",
"eslint": "^5.16.0",
"eslint-config-vtex-react": "^4.1.0",
"prettier": "^1.17.1",
"typescript": "^3.4.5"
},
"vtexTestTools": {
"defaultLocale": "en"
Expand Down
32 changes: 32 additions & 0 deletions react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"compilerOptions": {
"alwaysStrict": true,
"esModuleInterop": true,
"allowJs": true,
"jsx": "react",
"lib": ["es2017", "dom", "es2018.promise"],
"module": "es6",
"moduleResolution": "node",
"noEmitOnError": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"skipLibCheck": true,
"sourceMap": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"target": "es2017",
"typeRoots": ["node_modules/@types"],
"types": ["node", "jest", "graphql"]
},
"exclude": ["node_modules"],
"include": ["./typings/*.d.ts", "./**/*.tsx", "./**/*.ts"],
"typeAcquisition": {
"enable": false
}
}


Loading

0 comments on commit 99c5d73

Please sign in to comment.