Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(FEC-13600): Synchronize between lint and prettier #215

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 17 additions & 36 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"plugins": ["@typescript-eslint"],
"extends": ["plugin:prettier/recommended", "plugin:@typescript-eslint/recommended", "prettier"],
"plugins": ["prettier", "@typescript-eslint"],
"rules": {
"indent": ["error", 2],
"react/prefer-stateless-function": "off",
"max-len": ["warn", {"code": 500}],
"max-len": [
"error",
{
"code": 150,
"ignoreComments": true,
"ignoreStrings": true,
"ignoreUrls": true,
"ignoreTemplateLiterals": true,
"ignoreRegExpLiterals": true
}
],
"eol-last": "off",
"prettier/prettier": "off",
"prettier/prettier": "error",
"@typescript-eslint/explicit-function-return-type": "warn",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": "error",
// "@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-member-accessibility": [
"error",
Expand All @@ -26,44 +35,16 @@
}
}
],
"@typescript-eslint/ban-types": [
"error",
{
"extendDefaults": true,
"types": {
"Function": false // Overrides the rule for "Function" type only
}
}
],
"block-scoped-var": "error",
"eqeqeq": "error",
"no-var": "error",
"no-console": "error",
"prefer-const": "error",
"prefer-arrow-callback": "error",
"no-trailing-spaces": "error",
"quotes": ["warn", "single", {"avoidEscape": true}],
"no-restricted-properties": [
"error",
{
"object": "describe",
"property": "only"
},
{
"object": "it",
"property": "only"
}
]
"prefer-const": "error"
},
"overrides": [],
"settings": {
"jest": {
"version": 26
}
},
"settings": {},
"env": {
"browser": true,
"commonjs": true,
"es6": true
}
}
7 changes: 1 addition & 6 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
{
"printWidth": 150,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"jsxBracketSameLine": true,
"arrowParens": "avoid",
"proseWrap": "preserve"
"arrowParens": "always"
}
4 changes: 2 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const webpackConfig = require('./webpack.config')( null, {mode: 'development'});
const webpackConfig = require('./webpack.config')(null, { mode: 'development' });
delete webpackConfig.entry;
delete webpackConfig.externals;
delete webpackConfig.output;
Expand All @@ -17,7 +17,7 @@ module.exports = function (config) {
},
reporters: ['mocha'],
mochaReporter: {
showDiff: true,
showDiff: true
},

coverageIstanbulReporter: {
Expand Down
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
"build": "yarn run build:prod && yarn run build:types",
"build:types": "tsc --build tsconfig-lib.json && mkdir -p lib && api-extractor run --local",
"type-check": "tsc --noEmit",
"type-check:watch": "yarn run type-check -- --watch",
"type-check:watch": "yarn run type-check --watch",
"lint": "eslint src/ --ext .js --ext .ts",
"lint:fix": "yarn run lint -- --fix",
"lint:fix": "yarn run lint --fix",
"prettier": "prettier --write .",
"test": "karma start karma.conf.js",
"test:debug": "DEBUG_UNIT_TESTS=1 karma start karma.conf.js --auto-watch --no-single-run --browsers Chrome",
Expand All @@ -59,12 +59,14 @@
"@types/mocha": "^9.1.1",
"@types/sinon": "^10.0.20",
"@types/sinon-chai": "^3.2.12",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"@typescript-eslint/eslint-plugin": "^6.16.0",
"@typescript-eslint/parser": "^6.16.0",
"babel-loader": "^9.1.3",
"chai": "^4.3.6",
"copy-webpack-plugin": "^11.0.0",
"eslint": "^8.54.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.2",
"hls.js": "1.4.11",
"karma": "^6.4.0",
"karma-chrome-launcher": "^3.1.1",
Expand All @@ -75,7 +77,7 @@
"karma-sourcemap-loader": "^0.3.8",
"karma-webpack": "^5.0.0",
"mocha": "^10.0.0",
"prettier": "^3.0.3",
"prettier": "^3.1.1",
"sinon": "^14.0.0",
"sinon-chai": "^3.7.0",
"standard-version": "^6.0.1",
Expand Down
10 changes: 5 additions & 5 deletions src/errors.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Hlsjs from 'hls.js';
import {Error} from '@playkit-js/playkit-js';
import { Error } from '@playkit-js/playkit-js';

type ErrorDetailsType = {category: number, code: number};
type HlsJsErrorMapType = {[name: string]: ErrorDetailsType};
type ErrorDetailsType = { category: number; code: number };
type HlsJsErrorMapType = { [name: string]: ErrorDetailsType };

const HlsJsErrorMap: HlsJsErrorMapType = {
[Hlsjs.ErrorDetails.MANIFEST_LOAD_ERROR]: {
Expand Down Expand Up @@ -55,5 +55,5 @@ const HlsJsErrorMap: HlsJsErrorMapType = {
}
};

export {HlsJsErrorMap};
export type {ErrorDetailsType};
export { HlsJsErrorMap };
export { ErrorDetailsType };
Loading