Skip to content

Commit

Permalink
commit v3 code
Browse files Browse the repository at this point in the history
  • Loading branch information
hongqx committed Apr 7, 2023
1 parent a55e2f3 commit 8854b94
Show file tree
Hide file tree
Showing 1,272 changed files with 74,944 additions and 117,647 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[*.{js,jsx,ts,tsx,vue,css,less.scss,sass,styl,stylus}]
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
19 changes: 19 additions & 0 deletions .eslintignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
node_modules/*
browser/*
dist/*
fixtures/*
examples/*
/**/__tests__/*
/**/dist/*
/**/es/*
jest.config.js
jest.setup.js
babel.config.js
packages/xgplayer-flv.js/*
packages/xgplayer-hls.js/*
packages/xgplayer-shaka/*
packages/xgplayer-helper-transmuxers/*
packages/xgplayer-helper-utils/*
packages/xgplayer-m4a/*
packages/xgplayer-xgvideo/src/decoder/wasm/*
packages/xgplayer-xgvideo/src/decoder/webcodec/*
packages/xgplayer-xgvideo/src/polyfills/*
packages/xgplayer-flv.js/src/flv/*
packages/xgplayer-hls.js/src/hls.js/*
140 changes: 138 additions & 2 deletions .eslintrc.js
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,139 @@
module.exports = {
"extends": "standard"
};
extends: ['eslint:recommended', 'plugin:no-lookahead-lookbehind-regexp/recommended'],
plugins: ['import', 'node'],
parser: '@babel/eslint-parser',
parserOptions: {
requireConfigFile: false,
ecmaVersion: 12,
sourceType: 'module',
allowImportExportEverywhere: false
},
env: {
browser: true,
es2021: true,
node: true
},
globals: {
__VERSION__: 'readonly',
__DEV__: 'readonly',
module: 'readonly'
},
ignorePatterns: [
'node_modules/*',
'dist/*',
'examples/*',
'fixtures/*',
'/**/__tests__/*',
'/**/dist/*',
'/**/es/*',
'/**/lib/*',
'/**/liv/*',
'/**/browser/*'
],
overrides: [
{
files: ['packages/**/**.js'],
globals: {
fetch: true,
Headers: true,
global: true
}
}
],
rules: {
indent: ['error', 2, { SwitchCase: 1 }],
'no-trailing-spaces': 'error',
'space-infix-ops': 'error',
'multiline-ternary': ['error', 'always-multiline'], // 如果表达式跨越多行,则在三元表达式的操作数之间强制换行。
'spaced-comment': ['error', 'always'], // 注释空格
'no-multi-spaces': 'error',
'comma-dangle': ['error', 'never'], // 不使用拖尾逗号
quotes: [2, 'single'],
semi: ['error', 'never'], // 默认不使用分号
// Possible Errors
'getter-return': ['error', { allowImplicit: true }],
'no-control-regex': 'off',
'no-empty': ['error', { allowEmptyCatch: true }],
'no-extra-boolean-cast': 'off',
'no-inner-declarations': ['error', 'both'],
'no-irregular-whitespace': [
'error',
{
skipStrings: true,
skipComments: true,
skipRegExps: true,
skipTemplates: true
}
],
'no-prototype-builtins': 'off',
'no-unexpected-multiline': 'off',
'require-atomic-updates': 'off',
'no-cond-assign': 'off',
'no-constant-condition': ['error', { checkLoops: false }],
'no-implied-eval': 'error',
// best Practices
'block-scoped-var': 'warn',
'default-case': 'error',
eqeqeq: 'error',
'guard-for-in': 'warn',
'no-proto': 'error',
'no-useless-escape': 'off',
// space
'space-before-function-paren': ['error', {
'anonymous': 'always',
'named': 'always',
'asyncArrow': 'always'
}],
'keyword-spacing': ['error', { 'before': true, 'after': true }],
// es6
'no-duplicate-imports': 'error',
'no-var': 'error',
'prefer-const': 'warn',
'symbol-description': 'warn',

// Variables
'no-unused-vars': [
'error',
{
vars: 'all',
args: 'none',
ignoreRestSiblings: false,
caughtErrors: 'none'
}
],
'no-restricted-globals': [
'warn',
{
name: 'isFinite',
message:
'Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite'
},
{
name: 'isNaN',
message:
'Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan'
}
],
// 正则
'no-lookahead-lookbehind-regexp/no-lookahead-lookbehind-regexp': [
'error',
'no-lookahead',
'no-lookbehind',
'no-negative-lookahead',
'no-negative-lookbehind'
],

// import
'import/named': 'error',
'import/no-webpack-loader-syntax': 'error',
'import/no-self-import': 'error',
'import/export': 'error',
'import/no-named-as-default-member': 'error',

'import/no-absolute-path': 'warn',
'import/first': 'warn',
'import/no-useless-path-segments': ['warn', { commonjs: true }],
'import/no-deprecated': 'warn',
'import/no-duplicates': 'warn'
}
}
17 changes: 13 additions & 4 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,18 @@ typings/

#editor workspace file
.idea/


es/
lib/
browser/
dist/
types/
types/*
packages/*/types/
.DS_Store
fixtures/*/*
!fixtures/*/index.html

#http-server cert
*.pem

.history
examples
examples/
20 changes: 20 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// You can rename this file with name ".prettierrc.js" and
// place it into the root directory of your project.
// https://prettier.io/docs/en/options.html
module.exports = {
printWidth: 90,
tabWidth: 2,
useTabs: false,
semi: false,
singleQuote: true,
trailingComma: 'none',
arrowParens: 'avoid',
rangeStart: 0,
rangeEnd: Infinity,
bracketSpacing: true,
requirePragma: false,
insertPragma: false,
proseWrap: 'always',
htmlWhitespaceSensitivity: 'css',
endOfLine: 'auto'
}
1 change: 1 addition & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npmRegistryServer "https://registry.npmjs.org"
Loading

0 comments on commit 8854b94

Please sign in to comment.