Skip to content

Commit

Permalink
add esline
Browse files Browse the repository at this point in the history
  • Loading branch information
zhw2590582 committed Nov 21, 2018
1 parent f6ef3da commit b12507c
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 226 deletions.
10 changes: 3 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# http://editorconfig.org/
# See editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[{**/{actual,fixtures,expected,templates}/**,*.md}]
trim_trailing_whitespace = false
insert_final_newline = false
trim_trailing_whitespace = true
241 changes: 30 additions & 211 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,216 +1,35 @@
{
"root": true,
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true,
"globalReturn": true,
"impliedStrict": true
}
},
"parser": "babel-eslint",
"extends": ["airbnb-base", "prettier"],
"env": {
"es6": true,
"amd": true,
"node": true,
"mocha": true,
"worker": true,
"jquery": true,
"browser": true,
"commonjs": true,
"serviceworker": true,
"shared-node-browser": true
"browser": true,
"es6": true
},
"globals": {
"Artplayer": false,
"jQuery": false
},
"rules": {
"no-await-in-loop": 2,
"no-compare-neg-zero": 2,
"no-cond-assign": 2,
"no-console": 0,
"no-constant-condition": [2, { "checkLoops": false }],
"no-debugger": 2,
"no-dupe-args": 2,
"no-dupe-keys": 2,
"no-duplicate-case": 2,
"no-empty": 1,
"no-empty-character-class": 2,
"no-ex-assign": 2,
"no-extra-boolean-cast": 2,
"no-extra-parens": 2,
"no-extra-semi": 2,
"no-func-assign": 2,
"no-inner-declarations": 2,
"no-invalid-regexp": 2,
"no-irregular-whitespace": 2,
"no-obj-calls": 2,
"no-regex-spaces": 1,
"no-sparse-arrays": 2,
"no-template-curly-in-string": 2,
"no-unexpected-multiline": 2,
"no-unreachable": 2,
"no-unsafe-finally": 2,
"no-unsafe-negation": 2,
"use-isnan": 2,
"valid-jsdoc": [2, { "requireReturn": false }],
"valid-typeof": 2,

"accessor-pairs": 1,
"array-callback-return": 1,
"block-scoped-var": 1,
"class-methods-use-this": 0,
"curly": 1,
"default-case": 1,
"dot-location": [1, "property"],
"eqeqeq": [1, "smart"],
"guard-for-in": 1,
"no-alert": 2,
"no-caller": 1,
"no-div-regex": 1,
"no-else-return": 1,
"no-empty-function": 1,
"no-empty-pattern": 1,
"no-eq-null": 1,
"no-eval": 0,
"no-extend-native": 2,
"no-extra-bind": 1,
"no-extra-label": 1,
"no-fallthrough": 1,
"no-floating-decimal": 1,
"no-global-assign": 2,
"no-implicit-coercion": 1,
"no-implied-eval": 2,
"no-invalid-this": 1,
"no-iterator": 2,
"no-labels": 1,
"no-lone-blocks": 1,
"no-loop-func": 2,
"no-multi-spaces": 1,
"no-multi-str": 1,
"no-new-func": 0,
"no-new-wrappers": 1,
"no-octal": 1,
"no-octal-escape": 1,
"no-param-reassign": 1,
"no-proto": 1,
"no-redeclare": 1,
"no-return-assign": 1,
"no-return-await": 1,
"no-script-url": 2,
"no-self-assign": 1,
"no-self-compare": 1,
"no-sequences": 1,
"no-throw-literal": 1,
"no-unmodified-loop-condition": 1,
"no-unused-expressions": 0,
"no-unused-labels": 1,
"no-useless-call": 1,
"no-useless-concat": 1,
"no-useless-escape": 1,
"no-useless-return": 1,
"no-void": 1,
"no-with": 2,
"prefer-promise-reject-errors": 1,
"require-await": 2,
"vars-on-top": 1,
"wrap-iife": [1, "any"],
"yoda": 2,

"strict": 2,

"no-catch-shadow": 2,
"no-delete-var": 2,
"no-label-var": 2,
"no-shadow": 2,
"no-shadow-restricted-names": 2,
"no-undef": 2,
"no-undef-init": 2,
"no-undefined": 0,
"no-unused-vars": 2,
"no-use-before-define": 2,

"callback-return": 0,
"global-require": 1,
"handle-callback-err": 1,
"no-mixed-requires": [1, { "allowCall": true }],
"no-new-require": 2,
"no-path-concat": 2,
"no-process-env": 0,
"no-process-exit": 2,

"array-bracket-spacing": 1,
"block-spacing": 1,
"brace-style": 1,
"camelcase": 1,
"capitalized-comments": 0,
"comma-dangle": 1,
"comma-spacing": 1,
"comma-style": 1,
"computed-property-spacing": 1,
"consistent-this": [1, "that", "self"],
"eol-last": 1,
"func-call-spacing": 1,
"func-names": 1,
"indent": [1, 2, { "SwitchCase": 1 }],
"key-spacing": 1,
"keyword-spacing": 1,
"linebreak-style": 1,
"lines-around-comment": 1,
"new-cap": 0,
"new-parens": 1,
"no-array-constructor": 1,
"no-continue": 1,
"no-inline-comments": 1,
"no-mixed-spaces-and-tabs": 2,
"no-multi-assign": 1,
"no-multiple-empty-lines": 1,
"no-negated-condition": 0,
"no-nested-ternary": 2,
"no-new-object": 1,
"no-tabs": 2,
"no-trailing-spaces": 1,
"no-unneeded-ternary": 1,
"no-whitespace-before-property": 1,
"object-curly-spacing": 0,
"object-property-newline": [1, { "allowMultiplePropertiesPerLine": true }],
"one-var": [1, "never"],
"operator-assignment": 1,
"operator-linebreak": 1,
"padded-blocks": 0,
"quotes": [1, "single"],
"require-jsdoc": 0,
"semi": 1,
"semi-spacing": 1,
"space-before-blocks": 1,
"space-before-function-paren": [1, "never"],
"space-in-parens": 1,
"space-infix-ops": 1,
"space-unary-ops": [1, { "words": true, "nonwords": false }],
"spaced-comment": [1, "always"],
"wrap-regex": 1,

"arrow-body-style": 1,
"arrow-parens": 0,
"arrow-spacing": 1,
"constructor-super": 2,
"generator-star-spacing": 1,
"no-class-assign": 2,
"no-confusing-arrow": 0,
"no-const-assign": 2,
"no-dupe-class-members": 2,
"no-duplicate-imports": 2,
"no-new-symbol": 1,
"no-this-before-super": 2,
"no-useless-computed-key": 1,
"no-useless-constructor": 1,
"no-useless-rename": 1,
"no-var": 1,
"prefer-const": 1,
"prefer-destructuring": 1,
"prefer-spread": 0,
"prefer-template": 1,
"require-yield": 2,
"rest-spread-spacing": 1,
"symbol-description": 2,
"template-curly-spacing": 1,
"yield-star-spacing": 1
"import/no-cycle": 1,
"no-const-assign": 1,
"no-shadow": 0,
"no-this-before-super": 1,
"no-undef": 1,
"no-unreachable": 1,
"no-unused-vars": 1,
"constructor-super": 1,
"valid-typeof": 1,
"indent": [2, 4, { "SwitchCase": 1 }],
"quotes": [2, "single", "avoid-escape"],
"semi": [2, "always"],
"eqeqeq": [2, "always"],
"one-var": [2, "never"],
"comma-dangle": [2, "always-multiline"],
"spaced-comment": [2, "always"],
"no-restricted-globals": 2,
"no-param-reassign": [2, { "props": false }]
},
"parserOptions": {
"sourceType": "module"
}
}
}
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"useTabs": false,
"tabWidth": 4,
"singleQuote": true,
"trailingComma": "all",
"printWidth": 120
}
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
language: node_js

node_js:
- stable

before_script:
- npm install

script:
- npm run lint
Empty file added changelog.md
Empty file.
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"description": "ArtPlayer is a modern HTML5 video player",
"scripts": {
"bootstrap": "lerna bootstrap",
"publish": "lerna publish"
"publish": "lerna publish",
"build": "lerna run build",
"test": "lerna run test",
"lint": "eslint packages/*/src"
},
"repository": {
"type": "git",
Expand All @@ -21,6 +24,11 @@
},
"homepage": "https://github.com/zhw2590582/ArtPlayer#readme",
"devDependencies": {
"babel-eslint": "^10.0.1",
"eslint": "^5.9.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-config-prettier": "^3.3.0",
"eslint-plugin-import": "^2.14.0",
"lerna": "^3.4.3"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.artplayerPluginDanmu{display:flex}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*!
* artplayer-plugin-danmu.js v1.0.2
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2018 Harvey Zack
* Released under the MIT License.
*/

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e["artplayer-plugin-danmu"]={})}(this,function(e){"use strict";var n=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")},t=function e(){n(this,e),console.log(this)};window.ArtplayerPluginDanmu=t,e.default=t,Object.defineProperty(e,"__esModule",{value:!0})});
6 changes: 3 additions & 3 deletions packages/artplayer-plugin-danmu/src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import './style/index.scss';

class ArtplayerPluginDanmu {
constructor() {
console.log(this);
}
constructor() {
console.log(this);
}
}

window.ArtplayerPluginDanmu = ArtplayerPluginDanmu;
Expand Down
Loading

0 comments on commit b12507c

Please sign in to comment.