Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"presets": ["next/babel"],
"plugins": [
[
"import",
{
"libraryName": "antd",
"style": "css"
}
]
]
}

Empty file added .editorconfig
Empty file.
123 changes: 123 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"extends": [
"airbnb",
"plugin:react/recommended"
],
"plugins": ["react"],
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"parser": "babel-eslint",
"parserOptions":{
"ecmaVersion": 10,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"semi": ["error", "always"],
"camelcase": ["error", { "properties": "never" }],
"constructor-super": "error",
"comma-dangle": ["error", {
"arrays": "always-multiline",
"objects": "always-multiline"
}],
"object-curly-spacing": ["error", "always"],
"no-multiple-empty-lines": ["error", {
"max": 1,
"maxEOF": 1
}],
"eol-last": ["error", "always"],
"linebreak-style": 0,
"global-require": 0,
"eslint linebreak-style": [0, "error", "windows"],
"import/prefer-default-export": 0,
"indent": ["error", 4, {
"SwitchCase": 1,
"VariableDeclarator": 1,
"outerIIFEBody": 1,
"FunctionDeclaration": {
"parameters": 1,
"body": 1
},
"FunctionExpression": {
"parameters": 1,
"body": 1
},
"CallExpression": {
"arguments": 1
},
"ArrayExpression": 1,
"ObjectExpression": 1,
"ImportDeclaration": 1,
"flatTernaryExpressions": false,
"ignoredNodes": ["JSXElement", "JSXElement > *", "JSXAttribute", "JSXIdentifier", "JSXNamespacedName", "JSXMemberExpression", "JSXSpreadAttribute", "JSXExpressionContainer", "JSXOpeningElement", "JSXClosingElement", "JSXText", "JSXEmptyExpression", "JSXSpreadChild"],
"ignoreComments": false
}],
"no-param-reassign": ["error", { "props": false }],
"arrow-body-style": ["error", "as-needed"],
"arrow-parens": ["warn", "as-needed", {
"requireForBlockBody": false
}],
"arrow-spacing": ["error", {
"before": true,
"after": true
}],
"no-const-assign": "error",
"no-dupe-class-members": "error",
"no-duplicate-imports": "error",
"no-new-symbol": "error",
"no-this-before-super": "error",
"no-useless-computed-key": "error",
"no-useless-constructor": "warn",
"no-useless-rename": ["error", {
"ignoreDestructuring": false,
"ignoreImport": false,
"ignoreExport": false
}],
"no-var": "warn",
"object-curly-newline": ["error", { "consistent": true }],
"prefer-arrow-callback": ["warn", {
"allowUnboundThis": true
}],
"prefer-const": ["error", {
"destructuring": "all",
"ignoreReadBeforeAssign": true
}],
"prefer-template": "error",
"require-yield": "error",
"rest-spread-spacing": ["error", "never"],
"template-curly-spacing": "error",
"yield-star-spacing": ["error", "after"],
"prefer-spread": "error",
"generator-star-spacing": ["error", {
"before": false,
"after": true
}],
"symbol-description": "error",
"max-len": ["error", { "code": 100 }],
"sort-keys": ["error", "asc"],

"react/no-danger": "error",
"react/jsx-pascal-case": "error",
"react/jsx-closing-bracket-location": "error",
"react/jsx-indent": ["error", 4],
"react/jsx-indent-props": ["error", 4],
"react/void-dom-elements-no-children": "error",
"react/jsx-tag-spacing": "error",
"react/jsx-no-literals": "error",
"react/jsx-wrap-multilines": "error",
"react/jsx-no-comment-textnodes": "error",
"react/prefer-stateless-function": [0, { "ignorePureComponents": true }],
"react/require-default-props": [0, { "forbidDefaultForRequired": false }]
},
"settings": {
"react": {
"version": "latest"
}
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
package-lock.json
.next
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## How to start the server

```bash
# Run this line if it's the first time you try to build
npm i

npm run dev
```

# Front-end Developer Test
Using either Vue (preferably) or React framework, build a star wars directory using [SWAPI](https://swapi.co/), which has all api endpoints required for the application.

Expand Down
4 changes: 4 additions & 0 deletions components/rootReducer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { combineReducers } from 'redux';

export default combineReducers({
});
8 changes: 8 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const withCss = require('@zeit/next-css');

// fix: prevents error when .css files are required by node
if (typeof require !== 'undefined') {
require.extensions['.css'] = () => {};
}

module.exports = withCss();
4 changes: 4 additions & 0 deletions now.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }]
}
Loading