Skip to content

Commit

Permalink
Merge pull request video-dev#2548 from Korilakkuma/feat/prettier
Browse files Browse the repository at this point in the history
Fix code format
  • Loading branch information
tjenkinson authored Dec 24, 2020
2 parents 8030c31 + 87d696b commit ebf2fdc
Show file tree
Hide file tree
Showing 188 changed files with 16,797 additions and 8,892 deletions.
7 changes: 5 additions & 2 deletions .esdoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
"source": "./src",
"destination": "./api-docs",
"plugins": [
{"name": "@itsjamie/esdoc-standard-plugin"},
{"name": "@itsjamie/esdoc-typescript-plugin", "option": {"enable": true}},
{ "name": "@itsjamie/esdoc-standard-plugin" },
{
"name": "@itsjamie/esdoc-typescript-plugin",
"option": { "enable": true }
},
{
"name": "@itsjamie/esdoc-ecmascript-proposal-plugin",
"option": {
Expand Down
113 changes: 30 additions & 83 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
env: {
browser: true,
commonjs: true,
es6: true
es6: true,
},
globals: {
// Allowed globals
Expand All @@ -12,118 +12,65 @@ module.exports = {
__VERSION__: true,
__USE_SUBTITLES__: true,
__USE_ALT_AUDIO__: true,
__USE_EME_DRM__: true
__USE_EME_DRM__: true,
},
// see https://standardjs.com/
// see https://github.com/standard/eslint-config-standard
extends: [
'eslint:recommended',
'standard'
],
// 'prettier' (https://github.com/prettier/eslint-config-prettier) must be last
extends: ['eslint:recommended', 'prettier'],
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module'
sourceType: 'module',
},
plugins: [
'@typescript-eslint'
],
plugins: ['@typescript-eslint', 'import'],
rules: {
// our basic style rules
semi: [
'error',
'always'
],
indent: [
'error',
2
],
quotes: [
'error',
'single'
],
'linebreak-style': [
'error',
'unix'
],
// spacing
'space-infix-ops': 2,
'space-unary-ops': [2, { words: true, nonwords: false }],
'space-in-parens': ['error', 'never'],
'keyword-spacing': [2, { before: true, after: true }],
// enforce litteral objects on multiple lines
'block-spacing': 'error',
curly: 2,
'object-curly-spacing': ['error', 'always'],
'brace-style': ['error', '1tbs', { allowSingleLine: false }],

// limit code block and line length
/*
"max-len": 1,
"max-statements": 1,
"max-depth": 1,
"max-nested-callbacks": 1,
"max-params": 1,
"max-statements": 1,
"max-statements-per-line": 1
*/

// loosening of code-quality rules we may want to fix later
// (warnings for now)

// forbid "one var" style, enforce one declaration per variable
'one-var': 2,

'no-restricted-globals': [2,
'no-restricted-globals': [
2,
{
name: 'window',
message: 'Use `self` instead of `window` to access the global context everywhere (including workers).'
message:
'Use `self` instead of `window` to access the global context everywhere (including workers).',
},
{
name: 'SourceBuffer',
message: 'Use `self.SourceBuffer`'
message: 'Use `self.SourceBuffer`',
},
{
name: 'setTimeout',
message: 'Use `self.setTimeout`'
message: 'Use `self.setTimeout`',
},
{
name: 'setInterval',
message: 'Use `self.setInterval`'
}
message: 'Use `self.setInterval`',
},
],

'no-restricted-properties': [2,
'no-restricted-properties': [
2,
{ property: 'findIndex' }, // Intended to block usage of Array.prototype.findIndex
{ property: 'find' } // Intended to block usage of Array.prototype.find
{ property: 'find' }, // Intended to block usage of Array.prototype.find
],

'standard/no-callback-literal': 0,
'import/first': 1,
'no-var': 1,
'no-empty': 1,
'no-mixed-operators': 2,
'no-unused-vars': 2,
'no-unused-vars': 'warn',
'no-console': [
1,
{
allow: ['assert']
}
allow: ['assert'],
},
],
'no-fallthrough': 1,
'no-case-declarations': 2,
'no-irregular-whitespace': 1,
'no-self-assign': 1,
'new-cap': 1,
'no-undefined': 0,
'no-global-assign': 2,
'prefer-const': 2,
'dot-notation': 2,
'array-bracket-spacing': 2,
'quote-props': 2,
'no-void': 2,
'no-useless-catch': 2,
'lines-between-class-members': 2,
'no-prototype-builtins': 0
'no-prototype-builtins': 0,
},
overrides: [
{
Expand All @@ -132,16 +79,16 @@ module.exports = {
'no-unused-vars': 0,
'no-undef': 0,
'no-use-before-define': 'off',
// '@typescript-eslint/no-use-before-define': ['error'],
'@typescript-eslint/no-unused-vars': ['error', { args: 'none' }],
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/prefer-optional-chain': 2,
'@typescript-eslint/consistent-type-assertions': [2,
'@typescript-eslint/consistent-type-assertions': [
2,
{
assertionStyle: 'as',
objectLiteralTypeAssertions: 'never'
}
]
}
}
]
objectLiteralTypeAssertions: 'never',
},
],
},
},
],
};
12 changes: 6 additions & 6 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

#### **Did you find a bug?**

* **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/video-dev/hls.js/issues).
- **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/video-dev/hls.js/issues).

* If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/video-dev/hls.js/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring.
- If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/video-dev/hls.js/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring.

#### **Did you write a patch that fixes a bug?**

- First, checkout the repository and install required dependencies
- First, checkout the repository and install required dependencies

```sh
git clone https://github.com/video-dev/hls.js.git
Expand All @@ -25,7 +25,7 @@ npm run lint
npm run test
```

- Use [EditorConfig](http://editorconfig.org/) or at least stay consistent to the file formats defined in the `.editorconfig` file.
- Develop in a topic branch, not master
- Use [EditorConfig](http://editorconfig.org/) or at least stay consistent to the file formats defined in the `.editorconfig` file.
- Develop in a topic branch, not master

Thanks! :heart: :heart: :heart:
Thanks! :heart: :heart: :heart:
14 changes: 10 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
---
name: Bug report
about: Create a report to help us improve

---

### What version of Hls.js are you using?

### What browser and OS are you using?

### Test stream:

<!-- If possible, please provide a test stream or page -->
<!-- You can paste your stream into the demo and provide the permalink here -->

### Checklist

<!-- Replace [ ] with [x] to check off the list -->

- [ ] The issue observed is not already reported by searching on Github under https://github.com/video-dev/hls.js/issues
- [ ] The issue occurs in the stable client on https://hls-js.netlify.com/demo and not just on my page
<!-- The stable client is built from the latest release -->
Expand All @@ -23,20 +25,24 @@ about: Create a report to help us improve
- [ ] There are no network errors such as 404s in the browser console when trying to play the stream

### Steps to reproduce

1. Please provide clear steps to reproduce your problem
2. If the bug is intermittent, give a rough frequency

### Expected behavior
*What you expected to happen*

_What you expected to happen_

### Actual behavior
*What actually happened*

_What actually happened_

### Console output

```
Paste the contents of the browser console here.
```

```
For media errors reported on Chrome browser, please also paste the output of chrome://media-internals
For media errors reported on Chrome browser, please also paste the output of chrome://media-internals
```
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/question-.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
name: 'Question '
about: Need some help?

---

**What do you want to do with Hls.js?**
Expand Down
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ updates:
interval: daily
commit-message:
# prevent netlify build
prefix: "[skip ci]"
prefix: '[skip ci]'
open-pull-requests-limit: 99
versioning-strategy: increase-if-necessary
Loading

0 comments on commit ebf2fdc

Please sign in to comment.