Skip to content
This repository was archived by the owner on Apr 28, 2022. It is now read-only.

Commit fc225f1

Browse files
author
Steven Miller
authored
Merge pull request #535 from segmentio/standard
convert to standard
2 parents 5a911f7 + 5918f97 commit fc225f1

File tree

5 files changed

+27
-69
lines changed

5 files changed

+27
-69
lines changed

.eslintrc

Lines changed: 0 additions & 15 deletions
This file was deleted.

Makefile

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,25 @@
1-
#
2-
# Binaries.
3-
#
4-
5-
DUO = node_modules/.bin/duo
6-
ESLINT = node_modules/.bin/eslint
7-
UGLIFYJS = node_modules/.bin/uglifyjs
8-
9-
#
10-
# Files.
11-
#
121

132
SRC = $(wildcard lib/*.js)
143

15-
#
16-
# Chore tasks.
17-
#
18-
19-
# Install node dependencies.
20-
node_modules: package.json $(wildcard node_modules/*/package.json)
21-
@npm install
22-
@touch node_modules
4+
node_modules: package.json
5+
npm install
6+
touch $@
237

24-
# Remove temporary/built files.
258
clean:
269
rm -rf *.log analytics.js analytics.min.js
27-
.PHONY: clean
2810

29-
# Remove temporary/built files and vendor dependencies.
3011
distclean: clean
3112
rm -rf components node_modules
32-
.PHONY: distclean
3313

34-
#
35-
# Build tasks.
36-
#
37-
38-
# Build analytics.js.
3914
analytics.js: node_modules $(SRC) package.json
40-
@$(DUO) --stdout --standalone analytics lib/index.js > $@
15+
./node_modules/.bin/duo --stdout --standalone analytics lib/index.js > $@
4116

42-
# Build minified analytics.js.
4317
analytics.min.js: analytics.js
44-
@$(UGLIFYJS) $< --output $@
18+
./node_modules/.bin/uglifyjs $< --output $@
4519

46-
# Build shortcut.
4720
build: analytics.min.js
48-
.PHONY: build
49-
50-
#
51-
# Test tasks.
52-
#
5321

54-
# Lint JavaScript source.
5522
lint: node_modules
56-
@$(ESLINT) $(SRC)
57-
.PHONY: lint
23+
./node_modules/.bin/standard
24+
25+
.PHONY: clean distclean build lint

lib/index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,35 @@
22
/**
33
* Analytics.js
44
*
5-
* (C) 2015 Segment.io Inc.
5+
* (C) 2017 Segment Inc.
66
*/
77

8-
var analytics = require('segmentio/analytics.js-core');
9-
var Integrations = require('./integrations');
10-
var each = require('each');
8+
var analytics = require('segmentio/analytics.js-core')
9+
var Integrations = require('./integrations')
10+
var each = require('each')
1111

1212
/**
1313
* Expose the `analytics` singleton.
1414
*/
1515

16-
module.exports = exports = analytics;
16+
module.exports = exports = analytics
1717

1818
/**
1919
* Expose require.
2020
*/
2121

22-
analytics.require = require;
22+
analytics.require = require
2323

2424
/**
2525
* Expose `VERSION`.
2626
*/
2727

28-
exports.VERSION = require('../bower.json').version;
28+
exports.VERSION = require('../bower.json').version
2929

3030
/**
3131
* Add integrations.
3232
*/
3333

34-
each(Integrations, function(name, Integration) {
35-
analytics.use(Integration);
36-
});
34+
each(Integrations, function (name, Integration) {
35+
analytics.use(Integration)
36+
})

lib/integrations.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint quote-props: 0 */
2-
'use strict';
2+
'use strict'
33

44
module.exports = {
55
'adroll': require('analytics.js-integration-adroll'),
@@ -89,4 +89,4 @@ module.exports = {
8989
'woopra': require('analytics.js-integration-woopra'),
9090
'wootric': require('analytics.js-integration-wootric'),
9191
'yandex-metrica': require('analytics.js-integration-yandex-metrica')
92-
};
92+
}

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,13 @@
2424
"dependencies": {},
2525
"devDependencies": {
2626
"duo": "^0.12.0",
27-
"eslint": "0.x",
28-
"eslint-config-segment": "^1.0.7",
27+
"standard": "^8.6.0",
2928
"uglify-js": ">= 1.3.4"
29+
},
30+
"standard": {
31+
"ignore": [
32+
"analytics.js",
33+
"analytics.min.js"
34+
]
3035
}
3136
}

0 commit comments

Comments
 (0)