Skip to content

Commit

Permalink
Replace jshint and its rules by eslint equivalents
Browse files Browse the repository at this point in the history
* Removed grunt-contrib-jshint module
* generated rules from existing .jshintrc
* removed .jshintrc
* added globals
* fixed all issues that break linting/code style rules
  • Loading branch information
mlasak committed May 19, 2020
1 parent 5cc45bc commit af5f340
Show file tree
Hide file tree
Showing 18 changed files with 144 additions and 333 deletions.
42 changes: 41 additions & 1 deletion .eslintrc.json
Expand Up @@ -3,6 +3,35 @@
"sourceType": "module",
"ecmaVersion": 2015
},
"env": {
"browser": true,
"jquery": true,
"node": true,
"es6": true
},
"globals": {
"it": "readonly",
"describe": "readonly",
"beforeEach": "readonly",
"before": "readonly",
"afterEach": "readonly",
"after": "readonly",
"kendo": "readonly",
"utils": "readonly",
"MediaPlayer": "readonly",
"Dash": "readonly",
"WebKitMediaSource": "readonly",
"MediaSource": "readonly",
"WebKitMediaKeys": "readonly",
"MSMediaKeys": "readonly",
"MediaKeys": "readonly",
"Caster": "readonly",
"TextTrackCue": "readonly",
"HTMLMediaElement": "readonly",
"MediaError": "readonly",
"cea608parser": "readonly",
"dashjs": "readonly"
},
"rules": {
"indent": [
2,
Expand Down Expand Up @@ -53,6 +82,17 @@
{
"allowEmptyCatch": true
}
]
],
"no-caller": 2,
"no-use-before-define": [
2,
{
"functions": false
}
],
"no-undef": 2,
"no-unused-vars": 2,
"strict": 0,
"no-loop-func": 2
}
}
34 changes: 0 additions & 34 deletions .jshintrc

This file was deleted.

13 changes: 2 additions & 11 deletions Gruntfile.js
Expand Up @@ -15,15 +15,6 @@ module.exports = function (grunt) {
build: ['build/temp'],
dist: ['dist/*']
},
jshint: {
src: {
src: ['src/**/*.js', 'test/unit/mocks/*.js', 'test/unit/*.js', 'Gruntfile.js'],
options: {
jshintrc: '.jshintrc'
}
}
},

uglify: {
options: {
banner: '/*! v<%= pkg.version %>-<%= githash.dist.short %>, <%= grunt.template.today("isoUtcDateTime") %> */',
Expand Down Expand Up @@ -433,14 +424,14 @@ module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.loadNpmTasks('grunt-string-replace');
grunt.registerTask('default', ['dist', 'test']);
grunt.registerTask('dist', ['clean', 'jshint', 'eslint', 'browserify:mediaplayer', 'browserify:protection', 'browserify:reporting', 'browserify:mss', 'browserify:offline', 'browserify:all', 'babel:es5', 'minimize', 'copy:dist']);
grunt.registerTask('dist', ['clean', 'eslint', 'browserify:mediaplayer', 'browserify:protection', 'browserify:reporting', 'browserify:mss', 'browserify:offline', 'browserify:all', 'babel:es5', 'minimize', 'copy:dist']);
grunt.registerTask('minimize', ['exorcise', 'githash', 'uglify']);
grunt.registerTask('test', ['nyc:test']);
grunt.registerTask('watch', ['browserify:watch']);
grunt.registerTask('watch-dev', ['browserify:watch_dev']);
grunt.registerTask('release', ['default', 'jsdoc']);
grunt.registerTask('debug', ['clean', 'browserify:all', 'exorcise:all', 'copy:dist']);
grunt.registerTask('lint', ['jshint', 'eslint']);
grunt.registerTask('lint', ['eslint']);
grunt.registerTask('dev', ['browserSync', 'watch-dev']);
grunt.registerTask('deploy', ['string-replace', 'ftp_push']);
};
176 changes: 0 additions & 176 deletions package-lock.json

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

1 change: 0 additions & 1 deletion package.json
Expand Up @@ -33,7 +33,6 @@
"grunt-contrib-clean": "^2.0.0",
"grunt-contrib-connect": "^2.0.0",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-jshint": "^0.11.2",
"grunt-contrib-uglify": "^4.0.1",
"grunt-contrib-watch": "^1.1.0",
"grunt-eslint": "^22.0.0",
Expand Down
11 changes: 4 additions & 7 deletions src/mss/parser/MssParser.js
Expand Up @@ -114,7 +114,6 @@ function MssParser(config) {
let segmentTemplate,
qualityLevels,
representation,
segments,
i;

const name = streamIndex.getAttribute('Name');
Expand Down Expand Up @@ -184,8 +183,6 @@ function MssParser(config) {
// Set SegmentTemplate
adaptationSet.SegmentTemplate = segmentTemplate;

segments = segmentTemplate.SegmentTimeline.S_asArray;

return adaptationSet;
}

Expand Down Expand Up @@ -460,8 +457,8 @@ function MssParser(config) {
}

function getWRMHeaderFromPRHeader(prHeader) {
let length,
recordCount,
let // length,
// recordCount,
recordType,
recordLength,
recordValue;
Expand All @@ -470,11 +467,11 @@ function MssParser(config) {
// Parse PlayReady header

// Length - 32 bits (LE format)
length = (prHeader[i + 3] << 24) + (prHeader[i + 2] << 16) + (prHeader[i + 1] << 8) + prHeader[i];
// length = (prHeader[i + 3] << 24) + (prHeader[i + 2] << 16) + (prHeader[i + 1] << 8) + prHeader[i];

This comment has been minimized.

Copy link
@mlasak

mlasak May 19, 2020

Author Contributor

can this be removed completely, since it is apparently not used anywhere?

i += 4;

// Record count - 16 bits (LE format)
recordCount = (prHeader[i + 1] << 8) + prHeader[i];
// recordCount = (prHeader[i + 1] << 8) + prHeader[i];
i += 2;

// Parse records
Expand Down

0 comments on commit af5f340

Please sign in to comment.