Skip to content

Commit

Permalink
remove eslint style rules
Browse files Browse the repository at this point in the history
Rely solely on prettier for formatting.
  • Loading branch information
jlmakes committed Jan 4, 2018
1 parent 8b31dd9 commit b31bdcf
Show file tree
Hide file tree
Showing 34 changed files with 156 additions and 167 deletions.
73 changes: 27 additions & 46 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,29 @@
{
"env": {
"es6": true,
"amd": true,
"browser": true,
"mocha": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"globals": {
"describe": true,
"it": true,
"expect": true,
"sinon": true
},
"rules": {
"array-bracket-spacing": [2, "never", { "arraysInArrays": true }],
"arrow-spacing": 2,
"block-spacing": 2,
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
"comma-dangle": [2, "always-multiline"],
"comma-spacing": [2, { "before": false, "after": true }],
"eol-last": [2, "always"],
"indent": [2, "tab", { "SwitchCase": 1 }],
"key-spacing": 2,
"keyword-spacing": 2,
"no-cond-assign": 2,
"no-console": 1,
"no-const-assign": 2,
"no-class-assign": 2,
"no-this-before-super": 2,
"no-trailing-spaces": 2,
"no-unused-vars": 1,
"no-var": 2,
"no-mixed-spaces-and-tabs": [2, "smart-tabs"],
"object-curly-spacing": [2, "always"],
"object-shorthand": [2, "always"],
"semi": [2, "never"],
"space-before-blocks": [2, "always"],
"space-before-function-paren": [2, "always"],
"space-in-parens": [2, "never"],
"quote-props": [2, "as-needed"],
"quotes": [2, "single"]
}
"env": {
"es6": true,
"amd": true,
"browser": true,
"mocha": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"globals": {
"describe": true,
"it": true,
"expect": true,
"sinon": true
},
"rules": {
"no-cond-assign": 2,
"no-console": 1,
"no-const-assign": 2,
"no-class-assign": 2,
"no-this-before-super": 2,
"no-unused-vars": 1,
"no-var": 2,
"object-shorthand": [2, "always"]
}
}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
node_modules/
yarn.lock
package-lock.json
.vscode/
44 changes: 22 additions & 22 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"name": "scrollreveal",
"description": "Easy scroll animations for web and mobile browsers.",
"homepage": "https://scrollrevealjs.org",
"main": ["dist/scrollreveal.js"],
"repository": {
"type": "git",
"url": "https://github.com/jlmakes/scrollreveal.git"
},
"moduleType": ["amd", "node", "globals"],
"ignore": [
"**/.*",
"lib",
"src",
"test",
"gulpfile.js",
"karma.conf.js",
"package.json",
"saucelabs-browsers.js"
],
"keywords": ["scroll", "reveal", "animate", "animation"],
"authors": ["Julian Lloyd"],
"license": "GPL-3.0"
"name": "scrollreveal",
"description": "Easy scroll animations for web and mobile browsers.",
"homepage": "https://scrollrevealjs.org",
"main": ["dist/scrollreveal.js"],
"repository": {
"type": "git",
"url": "https://github.com/jlmakes/scrollreveal.git"
},
"moduleType": ["amd", "node", "globals"],
"ignore": [
"**/.*",
"lib",
"src",
"test",
"gulpfile.js",
"karma.conf.js",
"package.json",
"saucelabs-browsers.js"
],
"keywords": ["scroll", "reveal", "animate", "animation"],
"authors": ["Julian Lloyd"],
"license": "GPL-3.0"
}
4 changes: 2 additions & 2 deletions build/rollup.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export default {
plugins: [json(), nodeResolve({ jsnext: true, main: true }), buble()],
output: [
{ format: 'umd', file: 'dist/scrollreveal.js', name: 'ScrollReveal' },
{ format: 'es', file: 'dist/scrollreveal.es.js' },
],
{ format: 'es', file: 'dist/scrollreveal.es.js' }
]
}
12 changes: 6 additions & 6 deletions build/rollup.conf.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ export default {
buble(),
strip({
functions: ['logger'],
sourceMaps: false,
sourceMaps: false
}),
uglify({
output: {
comments: /@license ScrollReveal/,
},
}),
comments: /@license ScrollReveal/
}
})
],
output: {
format: 'iife',
file: 'dist/scrollreveal.min.js',
name: 'ScrollReveal',
},
name: 'ScrollReveal'
}
}
6 changes: 3 additions & 3 deletions src/instance/constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let _config
let _debug
let _instance

export default function ScrollReveal (options = {}) {
export default function ScrollReveal(options = {}) {
const invokedWithoutNew =
typeof this === 'undefined' ||
Object.getPrototypeOf(this) !== ScrollReveal.prototype
Expand Down Expand Up @@ -93,7 +93,7 @@ export default function ScrollReveal (options = {}) {
containers: {},
elements: {},
history: [],
sequences: {},
sequences: {}
}

this.pristine = true
Expand All @@ -120,5 +120,5 @@ Object.defineProperty(ScrollReveal, 'debug', {
get: () => _debug || false,
set: value => {
if (typeof value === 'boolean') _debug = value
},
}
})
12 changes: 6 additions & 6 deletions src/instance/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default {
rotate: {
x: 0,
y: 0,
z: 0,
z: 0
},
scale: 1,
container: document.documentElement,
Expand All @@ -21,10 +21,10 @@ export default {
top: 0,
right: 0,
bottom: 0,
left: 0,
left: 0
},
afterReset () {},
afterReveal () {},
beforeReset () {},
beforeReveal () {},
afterReset() {},
afterReveal() {},
beforeReset() {},
beforeReveal() {}
}
18 changes: 10 additions & 8 deletions src/instance/functions/animate.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import clean from '../methods/clean'

export default function animate (element, force = {}) {
export default function animate(element, force = {}) {
const pristine = force.pristine || this.pristine
const delayed =
element.config.useDelay === 'always' ||
Expand All @@ -19,11 +19,11 @@ export default function animate (element, force = {}) {
}
}

function triggerReveal (element, delayed) {
function triggerReveal(element, delayed) {
const styles = [
element.styles.inline.generated,
element.styles.opacity.computed,
element.styles.transform.generated.final,
element.styles.transform.generated.final
]
if (delayed) {
styles.push(element.styles.transition.generated.delayed)
Expand All @@ -35,19 +35,19 @@ function triggerReveal (element, delayed) {
registerCallbacks.call(this, element, delayed)
}

function triggerReset (element) {
function triggerReset(element) {
const styles = [
element.styles.inline.generated,
element.styles.opacity.generated,
element.styles.transform.generated.initial,
element.styles.transition.generated.instant,
element.styles.transition.generated.instant
]
element.revealed = false
element.node.setAttribute('style', styles.filter(s => s !== '').join(' '))
registerCallbacks.call(this, element)
}

function registerCallbacks (element, isDelayed) {
function registerCallbacks(element, isDelayed) {
const duration = isDelayed
? element.config.duration + element.config.delay
: element.config.duration
Expand All @@ -56,7 +56,9 @@ function registerCallbacks (element, isDelayed) {
? element.config.beforeReveal
: element.config.beforeReset

const afterCallback = element.revealed ? element.config.afterReveal : element.config.afterReset
const afterCallback = element.revealed
? element.config.afterReveal
: element.config.afterReset

let elapsed = 0
if (element.callbackTimer) {
Expand All @@ -74,6 +76,6 @@ function registerCallbacks (element, isDelayed) {
if (element.revealed && !element.config.reset) {
clean.call(this, element.node)
}
}, duration - elapsed),
}, duration - elapsed)
}
}
4 changes: 2 additions & 2 deletions src/instance/functions/delegate.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import getGeometry from '../../utils/get-geometry'
import getScrolled from '../../utils/get-scrolled'
import isElementVisible from '../../utils/is-element-visible'

export default function delegate (
export default function delegate(
event = { type: 'init' },
elements = this.store.elements
) {
Expand All @@ -22,7 +22,7 @@ export default function delegate (
if (container.scroll) {
container.direction = {
x: mathSign(scroll.left - container.scroll.left),
y: mathSign(scroll.top - container.scroll.top),
y: mathSign(scroll.top - container.scroll.top)
}
}
container.scroll = scroll
Expand Down
2 changes: 1 addition & 1 deletion src/instance/functions/initialize.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import each from '../../utils/each'
import rinse from './rinse'

export default function initialize () {
export default function initialize() {
rinse.call(this)

each(this.store.elements, element => {
Expand Down
4 changes: 2 additions & 2 deletions src/instance/functions/rinse.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import $ from 'tealight'
import each from '../../utils/each'

export default function rinse () {
export default function rinse() {
const struct = () => ({
active: [],
stale: [],
stale: []
})

const elementIds = struct()
Expand Down
8 changes: 4 additions & 4 deletions src/instance/functions/sequence.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import animate from './animate'
import each from '../../utils/each'
import nextUniqueId from '../../utils/next-unique-id'

export default function sequence (element, pristine = this.pristine) {
export default function sequence(element, pristine = this.pristine) {
const seq = this.store.sequences[element.sequence.id]
const i = element.sequence.index

Expand Down Expand Up @@ -74,7 +74,7 @@ export default function sequence (element, pristine = this.pristine) {
}
}

export function Sequence (interval) {
export function Sequence(interval) {
if (typeof interval === 'number') {
if (interval >= 16) {
/**
Expand Down Expand Up @@ -105,7 +105,7 @@ export function Sequence (interval) {
}
}

export function SequenceModel (prop, sequence, store) {
export function SequenceModel(prop, sequence, store) {
this.head = [] // Elements before the body with a falsey prop.
this.body = [] // Elements with a truthy prop.
this.foot = [] // Elements after the body with a falsey prop.
Expand All @@ -131,7 +131,7 @@ export function SequenceModel (prop, sequence, store) {
}
}

function cue (seq, i, direction, pristine) {
function cue(seq, i, direction, pristine) {
const blocked = ['headblocked', null, 'footblocked'][1 + direction]
const nextId = seq.members[i + direction]
const nextElement = this.store.elements[nextId]
Expand Down
Loading

0 comments on commit b31bdcf

Please sign in to comment.