Skip to content

Commit

Permalink
Merge pull request #312 from labzero/jeffrey/prettier
Browse files Browse the repository at this point in the history
Install Prettier
  • Loading branch information
JeffreyATW authored May 17, 2023
2 parents 358e989 + 77ddb81 commit 00497ef
Show file tree
Hide file tree
Showing 443 changed files with 10,358 additions and 8,636 deletions.
108 changes: 54 additions & 54 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,16 @@
// ESLint configuration
// http://eslint.org/docs/user-guide/configuring
module.exports = {
parser: '@typescript-eslint/parser',
parser: "@typescript-eslint/parser",

extends: [
'airbnb',
'plugin:css-modules/recommended',
'plugin:@typescript-eslint/recommended'
"airbnb",
"plugin:css-modules/recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
],

plugins: [
'css-modules',
'@typescript-eslint',
'import'
],
plugins: ["css-modules", "@typescript-eslint", "import"],

globals: {
__DEV__: true,
Expand All @@ -37,85 +34,88 @@ module.exports = {
rules: {
// `js` and `jsx` are common extensions
// `mjs` is for `universal-router` only, for now
'import/extensions': [
'error',
"import/extensions": [
"error",
{
js: 'never',
jsx: 'never',
mjs: 'never',
ts: 'never',
js: "never",
jsx: "never",
mjs: "never",
ts: "never",
},
],

// Not supporting nested package.json yet
// https://github.com/benmosher/eslint-plugin-import/issues/458
'import/no-extraneous-dependencies': 'off',
"import/no-extraneous-dependencies": "off",

'jsx-a11y/anchor-is-valid': [
'error',
"jsx-a11y/anchor-is-valid": [
"error",
{
specialLink: ['to'],
specialLink: ["to"],
},
],

// Recommend not to leave any console.log in your code
// Use console.error, console.warn and console.info instead
'no-console': [
'error',
"no-console": [
"error",
{
allow: ['warn', 'error', 'info'],
allow: ["warn", "error", "info"],
},
],

'prefer-destructuring': 0,
"prefer-destructuring": 0,

// Allow js files to use jsx syntax, too
'react/jsx-filename-extension': ['error', { extensions: ['.js', '.jsx', '.tsx'] }],
"react/jsx-filename-extension": [
"error",
{ extensions: [".js", ".jsx", ".tsx"] },
],

// Automatically convert pure class to function by
// babel-plugin-transform-react-pure-class-to-function
// https://github.com/kriasoft/react-starter-kit/pull/961
'react/prefer-stateless-function': 'off',
'comma-dangle': 0,
'key-spacing': 0,
'no-confusing-arrow': 0,
'react/jsx-quotes': 0,
'react/jsx-props-no-spreading': 0,
'max-len': 0,
'jsx-quotes': [
2,
'prefer-double'
],
'arrow-parens': 'off',
'generator-star-spacing': 'off',
'import/prefer-default-export': 0,
"react/prefer-stateless-function": "off",
"comma-dangle": 0,
"key-spacing": 0,
"no-confusing-arrow": 0,
"react/jsx-quotes": 0,
"react/jsx-props-no-spreading": 0,
"max-len": 0,
"jsx-quotes": [2, "prefer-double"],
"arrow-parens": "off",
"generator-star-spacing": "off",
"import/prefer-default-export": 0,

'react/forbid-prop-types': 'off',
'react/destructuring-assignment': 'off',
'react/function-component-definition': ['error', {
namedComponents: 'arrow-function',
unnamedComponents: 'arrow-function'
}],
'react/static-property-placement': 'off',
'import/no-relative-packages': 'off',
'import/no-import-module-exports': 'off'
"react/forbid-prop-types": "off",
"react/destructuring-assignment": "off",
"react/function-component-definition": [
"error",
{
namedComponents: "arrow-function",
unnamedComponents: "arrow-function",
},
],
"react/static-property-placement": "off",
"import/no-relative-packages": "off",
"import/no-import-module-exports": "off",
},

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': {
"import/resolver": {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
moduleDirectory: ['node_modules', 'src'],
extensions: [".js", ".jsx", ".ts", ".tsx"],
moduleDirectory: ["node_modules", "src"],
},
typescript: {
alwaysTryTypes: true, // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
extensions: ['.ts', '.tsx'],
}
extensions: [".ts", ".tsx"],
},
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"],
},
},
};
6 changes: 3 additions & 3 deletions .mocharc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
extension: ['ts'],
require: ['./test/setup'],
extension: ["ts"],
require: ["./test/setup"],
exit: true,
file: './test/mocha-setup',
file: "./test/mocha-setup",
};
13 changes: 3 additions & 10 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
{
"require": [
"@babel/register"
],
"include": [
"src"
],
"reporter": [
"lcov",
"text"
],
"require": ["@babel/register"],
"include": ["src"],
"reporter": ["lcov", "text"],
"sourceMap": false,
"instrument": false
}
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ignore artifacts:
build
coverage
.nyc_output
.vscode
.yarn
1 change: 1 addition & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
63 changes: 31 additions & 32 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,62 +12,61 @@ const lowerKebabCase = /^[a-z][a-zA-Z0-9]+$/;
// stylelint configuration
// https://stylelint.io/user-guide/configuration/
module.exports = {

// The standard config based on a handful of CSS style guides
// https://github.com/stylelint/stylelint-config-standard
extends: 'stylelint-config-standard-scss',
extends: "stylelint-config-standard-scss",

plugins: [
// stylelint plugin to sort CSS rules content with specified order
// https://github.com/hudochenkov/stylelint-order
'stylelint-order',
"stylelint-order",
],

rules: {
'at-rule-no-unknown': null,
'scss/at-rule-no-unknown': true,
'declaration-empty-line-before': null,
'keyframes-name-pattern': lowerKebabCase,
'number-leading-zero': 'never',
'property-no-unknown': [true, {
ignoreProperties: [
// CSS Modules composition
// https://github.com/css-modules/css-modules#composition
'composes',
'overflow-anchor'
],
}],
'selector-class-pattern': lowerKebabCase,
"at-rule-no-unknown": null,
"scss/at-rule-no-unknown": true,
"declaration-empty-line-before": null,
"keyframes-name-pattern": lowerKebabCase,
"number-leading-zero": "never",
"property-no-unknown": [
true,
{
ignoreProperties: [
// CSS Modules composition
// https://github.com/css-modules/css-modules#composition
"composes",
"overflow-anchor",
],
},
],
"selector-class-pattern": lowerKebabCase,

'selector-pseudo-class-no-unknown': [
"selector-pseudo-class-no-unknown": [
true,
{
ignorePseudoClasses: [
// CSS Modules :global scope
// https://github.com/css-modules/css-modules#exceptions
'global',
'local',
"global",
"local",
],
},
],

// Opinionated rule, you can disable it if you want
'string-quotes': 'single',

// https://github.com/hudochenkov/stylelint-order/blob/master/rules/order/README.md
'order/order': [
'custom-properties',
'dollar-variables',
"order/order": [
"custom-properties",
"dollar-variables",
{
type: 'at-rule',
name: 'include',
type: "at-rule",
name: "include",
},
'declarations',
'at-rules',
'rules',
"declarations",
"at-rules",
"rules",
],

// https://github.com/hudochenkov/stylelint-order/blob/master/rules/properties-order/README.md
'order/properties-order': [],
"order/properties-order": [],
},
};
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: node_js
node_js:
- 'stable'
- '8'
- '6'
- "stable"
- "8"
- "6"
env:
- CXX=g++-4.8
addons:
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
}
2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.5.1.cjs
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ All notable changes to this project will be documented in this file.
- Move page / screen components into the `src/routes` folder along with the routing information for them (BREAKING CHANGE). [6553936](https://github.com/kriasoft/react-starter-kit/commit/6553936e693e24a8ac6178f4962af15e0ea87dfd)

### [v0.5.1]

> 2016-03-02
- Remove `Html` React component in favor of compiled Jade templates (`src/views`) (BREAKING CHANGE). [e188388](https://github.com/kriasoft/react-starter-kit/commit/e188388f87069cdc7d501b385d6b0e46c98fed60)
- Add global error handling in Node.js/Express app. [e188388](https://github.com/kriasoft/react-starter-kit/commit/e188388f87069cdc7d501b385d6b0e46c98fed60)
- Add support for Markdown and HTML for static pages. [#469](https://github.com/kriasoft/react-starter-kit/pull/469), [#477](https://github.com/kriasoft/react-starter-kit/pull/477)

### [v0.5.0]

> 2016-02-27
- Replace RESTful API endpoint (`src/api`) with GraphQL (`src/data`)
Expand All @@ -54,6 +56,7 @@ All notable changes to this project will be documented in this file.
- Add `CHANGELOG.md` file with a list of notable changes to this project

### [v0.4.1]

> 2015-10-04
- Replace React Hot Loader (deprecated) with React Transform
Expand Down
16 changes: 8 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ files right from GitHub website as described [here](https://help.github.com/arti

Before opening an issue, please:

* Check the [Getting Started](https://github.com/kriasoft/react-starter-kit/blob/master/docs/getting-started.md) guide.
* Search the [issue tracker](https://github.com/kriasoft/react-starter-kit/issues) to make sure
- Check the [Getting Started](https://github.com/kriasoft/react-starter-kit/blob/master/docs/getting-started.md) guide.
- Search the [issue tracker](https://github.com/kriasoft/react-starter-kit/issues) to make sure
your issue hasn’t already been reported.
* If your issue sounds more like a question, please post it on StackOverflow.com instead with the
- If your issue sounds more like a question, please post it on StackOverflow.com instead with the
tag [react-starter-kit](http://stackoverflow.com/questions/tagged/react-starter-kit).

### Pull Requests

Before you submit a [pull request](https://help.github.com/articles/using-pull-requests/) from your
forked repo, check that it meets these guidelines:

* If the pull request adds functionality, the docs should be updated as part of the same PR.
* Create a separate PR for each small feature or bug fix.
* [Squash](http://stackoverflow.com/questions/5189560/squash-my-last-x-commits-together-using-git)
- If the pull request adds functionality, the docs should be updated as part of the same PR.
- Create a separate PR for each small feature or bug fix.
- [Squash](http://stackoverflow.com/questions/5189560/squash-my-last-x-commits-together-using-git)
your commits into one for each PR.
* Run `yarn test` to make sure that your code style is OK and there are no any regression bugs.
* When contributing to an opt-in feature, apply the `[feature/...]` tag as a prefix to your PR title
- Run `yarn test` to make sure that your code style is OK and there are no any regression bugs.
- When contributing to an opt-in feature, apply the `[feature/...]` tag as a prefix to your PR title

#### Style Guide

Expand Down
Loading

0 comments on commit 00497ef

Please sign in to comment.