Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(structure): init library structure using create-react-library
- add .env in example folder for absolute path use - update ExampleComponent to be SuperTimer - configure code quality tools: eslint, lintstaged, commitlint - remove .editorconfig
- Loading branch information
1 parent
7231531
commit 2518fac
Showing
22 changed files
with
18,287 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"presets": [ | ||
["env", { | ||
"modules": false | ||
}], | ||
"stage-0", | ||
"react" | ||
], | ||
"plugins": [ | ||
"external-helpers" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": ["@commitlint/config-conventional"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
module.exports = { | ||
parser: "babel-eslint", | ||
extends: ["airbnb", "prettier", "prettier/react"], | ||
env: { | ||
es6: true, | ||
browser: true, | ||
node: true, | ||
jest: true | ||
}, | ||
plugins: ["react", "prettier"], | ||
parserOptions: { | ||
sourceType: "module", | ||
allowImportExportEverywhere: true | ||
}, | ||
rules: { | ||
// don't force es6 functions to include space before parenthesis | ||
"space-before-function-paren": 0, | ||
|
||
// allow specifying true explicitly for boolean props | ||
"react/jsx-boolean-value": 0, | ||
|
||
// allow imports mixed with non-import statements at top of file | ||
"import/first": 0, | ||
|
||
// Forbid the use of extraneous packages | ||
// https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-extraneous-dependencies.md | ||
"import/no-extraneous-dependencies": ["error", { packageDir: "." }], | ||
|
||
// Prefer destructuring from arrays and objects | ||
// http://eslint.org/docs/rules/prefer-destructuring | ||
"prefer-destructuring": [ | ||
"error", | ||
{ | ||
VariableDeclarator: { | ||
array: false, | ||
object: true | ||
}, | ||
AssignmentExpression: { | ||
array: false, | ||
object: false | ||
} | ||
}, | ||
{ | ||
enforceForRenamedProperties: false | ||
} | ||
], | ||
|
||
// Allow .js files to use JSX syntax | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md | ||
"react/jsx-filename-extension": [1, { extensions: [".js", ".jsx"] }], | ||
|
||
// Functional and class components are equivalent from React’s point of view | ||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prefer-stateless-function.md | ||
"react/prefer-stateless-function": "off", | ||
|
||
// Ensure <a> tags are valid | ||
// https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md | ||
"jsx-a11y/anchor-is-valid": [ | ||
"error", | ||
{ | ||
components: ["Link"], | ||
specialLink: ["to"], | ||
aspects: ["noHref", "invalidHref", "preferButton"] | ||
} | ||
], | ||
|
||
// ESLint plugin for prettier formatting | ||
// https://github.com/prettier/eslint-plugin-prettier | ||
"prettier/prettier": "error", | ||
|
||
// Disable no-param-reassign only for param properties | ||
// https://stackoverflow.com/a/35637900 | ||
"no-param-reassign": [2, { props: false }] | ||
}, | ||
settings: { | ||
// Allow absolute paths in imports, e.g. import Button from 'components/Button' | ||
// https://github.com/benmosher/eslint-plugin-import/tree/master/resolvers | ||
"import/resolver": { | ||
node: { | ||
moduleDirectory: ["node_modules", "src"] | ||
} | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
# See https://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
node_modules | ||
|
||
# builds | ||
build | ||
dist | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"*.{js,jsx}": [ | ||
"prettier --write", | ||
"git add" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,33 @@ | ||
# react-super-timer | ||
Super Timer is a fully controllable and customizable timer component for react | ||
|
||
> Super Timer is a fully controllable and customizable timer component for react | ||
[![NPM](https://img.shields.io/npm/v/react-super-timer.svg)](https://www.npmjs.com/package/react-super-timer) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) | ||
|
||
## Install | ||
|
||
```bash | ||
npm install --save react-super-timer | ||
or | ||
yarn react-super-timer | ||
``` | ||
|
||
## Usage | ||
|
||
```jsx | ||
import React, { Component } from 'react' | ||
|
||
import SuperTimer from 'react-super-timer' | ||
|
||
class Example extends Component { | ||
render () { | ||
return ( | ||
<SuperTimer /> | ||
) | ||
} | ||
} | ||
``` | ||
|
||
## License | ||
|
||
MIT © [yassinedoghri](https://github.com/yassinedoghri) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
NODE_PATH=src/ |
Oops, something went wrong.