Skip to content

Commit

Permalink
format everything with prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
no-chris committed Oct 19, 2021
1 parent aa6241e commit f048a32
Show file tree
Hide file tree
Showing 180 changed files with 2,999 additions and 2,784 deletions.
92 changes: 49 additions & 43 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,67 +1,73 @@
/* eslint-env node */
module.exports = {
'env': {
'browser': true,
'es6': true
env: {
browser: true,
es6: true,
},
'plugins': [
plugins: [
'import',
'no-unsanitized',
'react-hooks',
'jam3', // for dangerouslySetInnerHTML
],

'extends': [
'eslint:recommended',
'plugin:react/recommended',
],
'globals': {
'Atomics': 'readonly',
'SharedArrayBuffer': 'readonly'
extends: ['eslint:recommended', 'plugin:react/recommended'],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
'parserOptions': {
'ecmaVersion': 2018,
'sourceType': 'module',
'jsx': true,
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
jsx: true,
},
'rules': {
'complexity': [ 'error', { max: 10 } ],
'indent': [ 'error', 'tab', { 'SwitchCase': 1 } ],
'linebreak-style': [ 'error', 'unix' ],
'max-depth': [ 'error', 4 ],
'max-len': [ 'error', {'code': 150 } ],
'max-lines': [ 'error', { max: 300, skipBlankLines: true, skipComments: true, } ],
'max-params': [ 'warn', { max: 4 } ],
'no-shadow': [ 'error', { 'builtinGlobals': true } ],
'quotes': [ 'error', 'single' ],
'semi': [ 'error', 'always' ],
rules: {
complexity: ['error', { max: 10 }],
indent: ['error', 'tab', { SwitchCase: 1 }],
'linebreak-style': ['error', 'unix'],
'max-depth': ['error', 4],
'max-len': ['error', { code: 150 }],
'max-lines': [
'error',
{ max: 300, skipBlankLines: true, skipComments: true },
],
'max-params': ['warn', { max: 4 }],
'no-shadow': ['error', { builtinGlobals: true }],
semi: ['error', 'always'],

'no-restricted-imports':[
'no-restricted-imports': [
'error',
{
paths: [
{
name: 'lodash',
message: 'Please do not import lodash as a whole: import individual lodash functions instead.'
}
]
}
message:
'Please do not import lodash as a whole: import individual lodash functions instead.',
},
],
},
],

'jam3/no-sanitizer-with-danger': ['error', { wrapperName: ['escapeHTML'] }],

'no-unsanitized/property': [ 'error', { escape: { methods: ['escapeHTML'] } } ],
'no-unsanitized/method': [ 'error' ],
'jam3/no-sanitizer-with-danger': [
'error',
{ wrapperName: ['escapeHTML'] },
],

'react/prop-types': [ 'error' ],
'no-unsanitized/property': [
'error',
{ escape: { methods: ['escapeHTML'] } },
],
'no-unsanitized/method': ['error'],

'react-hooks/rules-of-hooks': [ 'error' ],
'react-hooks/exhaustive-deps': [ 'warn' ],
'react/prop-types': ['error'],

'react-hooks/rules-of-hooks': ['error'],
'react-hooks/exhaustive-deps': ['warn'],
},
'settings': {
'react': {
'pragma': 'React',
'version': 'detect'
settings: {
react: {
pragma: 'React',
version: 'detect',
},
}
},
};
7 changes: 7 additions & 0 deletions .idea/prettier.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
coverage
CHANGELOG.md
docs
package.json
package-lock.json
SLOC
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"endOfLine": "lf",
"semi": true,
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "es5",
"useTabs": true
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ test: `npm run test`

build: `npm run build`

run development server on http://127.0.0.1:8084 : `npm run dev`
run development server on http://127.0.0.1:8084 : `npm run dev`
34 changes: 17 additions & 17 deletions SLOC
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ Source code:

---------- Result ------------

Physical : 4517
Source : 3596
Comment : 86
Single-line comment : 37
Block comment : 49
Physical : 4524
Source : 3759
Comment : 98
Single-line comment : 34
Block comment : 64
Mixed : 1
Empty block comment : 0
Empty : 836
Empty block comment : 2
Empty : 670
To Do : 0

Number of files read : 112
Expand All @@ -20,14 +20,14 @@ Tests:

---------- Result ------------

Physical : 4162
Source : 3203
Physical : 4389
Source : 3555
Comment : 43
Single-line comment : 38
Block comment : 5
Mixed : 0
Empty block comment : 0
Empty : 916
Empty : 791
To Do : 0

Number of files read : 49
Expand All @@ -38,14 +38,14 @@ Total:

---------- Result ------------

Physical : 8679
Source : 6799
Comment : 129
Single-line comment : 75
Block comment : 54
Physical : 8913
Source : 7314
Comment : 141
Single-line comment : 72
Block comment : 69
Mixed : 1
Empty block comment : 0
Empty : 1752
Empty block comment : 2
Empty : 1461
To Do : 0

Number of files read : 161
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const presets = [
'@babel/preset-env',
{
targets: {
browsers: 'defaults'
browsers: 'defaults',
},
corejs: '3.0',
useBuiltIns: 'usage',
Expand Down
2 changes: 2 additions & 0 deletions docs/css/main.2e13975f5eb9e07bb6a8.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/css/main.2e13975f5eb9e07bb6a8.css.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions docs/css/main.917a21db3f64c6c14201.css

This file was deleted.

1 change: 0 additions & 1 deletion docs/css/main.917a21db3f64c6c14201.css.map

This file was deleted.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html class="no-js" lang="en_EN"><head><meta charset="utf-8"><meta http-equiv="x-ua-compatible" content="ie=edge"><title>Chords Charts Studio</title><meta name="description" content=""><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Roboto+Mono:400,700" rel="stylesheet"><link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"><script defer="defer" src="vendors.917a21db3f64c6c14201.js"></script><script defer="defer" src="main.917a21db3f64c6c14201.js"></script><link href="css/main.917a21db3f64c6c14201.css" rel="stylesheet"></head><body><div id="app" class="theme-dark"></div></body></html>
<!doctype html><html class="no-js" lang="en_EN"><head><meta charset="utf-8"><meta http-equiv="x-ua-compatible" content="ie=edge"><title>Chords Charts Studio</title><meta name="description" content=""><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><link href="https://fonts.googleapis.com/css?family=Open+Sans:400,700|Roboto+Mono:400,700" rel="stylesheet"><link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"><script defer="defer" src="vendors.2e13975f5eb9e07bb6a8.js"></script><script defer="defer" src="main.2e13975f5eb9e07bb6a8.js"></script><link href="css/main.2e13975f5eb9e07bb6a8.css" rel="stylesheet"></head><body><div id="app" class="theme-dark"></div></body></html>
2 changes: 2 additions & 0 deletions docs/main.2e13975f5eb9e07bb6a8.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/main.2e13975f5eb9e07bb6a8.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions docs/main.917a21db3f64c6c14201.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/main.917a21db3f64c6c14201.js.map

This file was deleted.

3 changes: 3 additions & 0 deletions docs/vendors.2e13975f5eb9e07bb6a8.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ object-assign
@license MIT
*/

/*! @license DOMPurify 2.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.3.3/LICENSE */

/*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.2.2/LICENSE */

/*! Universal Router | MIT License | https://www.kriasoft.com/universal-router/ */
Expand Down
1 change: 1 addition & 0 deletions docs/vendors.2e13975f5eb9e07bb6a8.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions docs/vendors.917a21db3f64c6c14201.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/vendors.917a21db3f64c6c14201.js.map

This file was deleted.

28 changes: 11 additions & 17 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,30 @@ module.exports = {
testEnvironment: 'jsdom',

collectCoverage: true,
collectCoverageFrom: [
'src/**/*.js',
'!src/main.js',
'!**/node_modules/**'
],
collectCoverageFrom: ['src/**/*.js', '!src/main.js', '!**/node_modules/**'],
coverageDirectory: '<rootDir>/coverage',
coveragePathIgnorePatterns: [
'node_modules',
'src/ui/layout/app/createGetVersions.js'
'src/ui/layout/app/createGetVersions.js',
],
coverageReporters: ['json', 'lcov', 'text', 'clover'],
coverageThreshold: {
'global': {
'branches': 99,
'functions': 99,
'lines': 99,
'statements': 100
}
global: {
branches: 99,
functions: 99,
lines: 99,
statements: 100,
},
},

transform: {
'\\.js$': 'babel-jest',
'\\.hbs$': 'jest-handlebars',
},

setupFiles: [
'jest-localstorage-mock'
],
setupFiles: ['jest-localstorage-mock'],

moduleNameMapper: {
'\\.(css|scss)$': '<rootDir>/scss/__mocks__/styleMock.js'
}
'\\.(css|scss)$': '<rootDir>/scss/__mocks__/styleMock.js',
},
};
Loading

0 comments on commit f048a32

Please sign in to comment.