├── logo ├── logo.png └── logo.svg ├── .flowconfig ├── .gitignore ├── src ├── index.js ├── babelConfig.js ├── cli.js ├── utils.js ├── Logger.js └── ReactTester.js ├── libdefs.js ├── .babelrc ├── test ├── fixtures │ ├── Valid.js │ └── NoDefaultExport.js └── ReactTester.test.js ├── .travis.yml ├── .editorconfig ├── CHANGELOG.md ├── .eslintrc ├── LICENSE ├── package.json └── README.md /logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diegohaz/singel/HEAD/logo/logo.png -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | .*/dist 3 | .*/coverage 4 | 5 | [libs] 6 | ./libdefs.js 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .cache 3 | node_modules 4 | coverage 5 | dist 6 | *.log 7 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import ReactTester from "./ReactTester"; 2 | 3 | export { ReactTester }; 4 | -------------------------------------------------------------------------------- /libdefs.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | declare module "react-known-props" { 3 | declare module.exports: any; 4 | } 5 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "targets": { 5 | "node": 6 6 | } 7 | }], 8 | "stage-2", 9 | "react", 10 | "flow" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /test/fixtures/Valid.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | // eslint-disable-next-line 4 | const Valid = ({ children, ...props }) =>
2 |
3 | [](https://github.com/diegohaz/nod)
4 | [](https://npmjs.org/package/singel)
5 | [](https://travis-ci.org/diegohaz/singel) [](https://codecov.io/gh/diegohaz/singel/branch/master)
6 |
7 | **Single Element Pattern** (Singel) is a set of rules/best practices to create consistent, reliable and maintainable components in React and other component-based libraries. This is based on the idea that the **building blocks** of an application should resemble as most as possible native HTML elements. [**Read full article**](https://medium.freecodecamp.org/introducing-the-single-element-pattern-dfbd2c295c5d)
8 |
9 | This repo is a CLI tool for checking whether React components conform to the Singel pattern.
10 |
11 |
13 |