Browse Source

Improves linting

pull/1629/merge
Ændrew Rininsland 8 years ago committed by Yoshiya Hinosawa
parent
commit
81e29c3176
  1. 15
      .jshintrc
  2. 4
      Gruntfile.coffee
  3. 1
      src/api.region.js
  4. 4
      src/axis.js
  5. 2
      src/class-utils.js
  6. 6
      src/core.js
  7. 4
      src/index.js
  8. 1
      src/title.js

15
.jshintrc

@ -1,4 +1,5 @@
{ {
"esversion": 6,
"eqeqeq": true, "eqeqeq": true,
"curly": true, "curly": true,
"strict": false, "strict": false,
@ -8,7 +9,6 @@
"undef": true, "undef": true,
"unused": true, "unused": true,
"indent": 4, "indent": 4,
"eqnull": true, "eqnull": true,
"expr": true, "expr": true,
"newcap": false, "newcap": false,
@ -16,18 +16,9 @@
"bitwise": false, "bitwise": false,
"browser": true, "browser": true,
"jasmine": true,
"globals": { "globals": {
"jasmine": false, "d3": false
"describe": false,
"beforeEach": false,
"beforeAll": false,
"it": false,
"expect": false,
"d3": false,
"module": false,
"require": false,
"define": false
} }
} }

4
Gruntfile.coffee

@ -8,8 +8,8 @@ module.exports = (grunt) ->
files: ['src/scss/*.scss'] files: ['src/scss/*.scss']
jshint: jshint:
c3: 'c3.js' c3: 'src/**/*.js'
spec: 'spec/*.js' spec: 'spec/**/*.js'
options: options:
reporter: require('jshint-stylish') reporter: require('jshint-stylish')
jshintrc: '.jshintrc' jshintrc: '.jshintrc'

1
src/api.region.js

@ -1,6 +1,5 @@
import CLASS from './class'; import CLASS from './class';
import { c3_chart_fn } from './core'; import { c3_chart_fn } from './core';
import { getOption } from './util';
c3_chart_fn.regions = function (regions) { c3_chart_fn.regions = function (regions) {
var $$ = this.internal, config = $$.config; var $$ = this.internal, config = $$.config;

4
src/axis.js

@ -1,7 +1,7 @@
import CLASS from './class'; import CLASS from './class';
import { inherit, API } from './core' import { inherit, API } from './core';
import { isValue, isFunction, isString, isEmpty } from './util'; import { isValue, isFunction, isString, isEmpty } from './util';
import c3_axis from './c3.axis' import c3_axis from './c3.axis';
export default function Axis(owner) { export default function Axis(owner) {
API.call(this, owner); API.call(this, owner);

2
src/class-utils.js

@ -1,4 +1,4 @@
import CLASS from './class' import CLASS from './class';
import { c3_chart_internal_fn } from './core'; import { c3_chart_internal_fn } from './core';
c3_chart_internal_fn.generateClass = function (prefix, targetId) { c3_chart_internal_fn.generateClass = function (prefix, targetId) {

6
src/core.js

@ -1,3 +1,4 @@
import * as d3 from 'd3';
import Axis from './axis'; import Axis from './axis';
import CLASS from './class'; import CLASS from './class';
import { isValue, isFunction, isString, isUndefined, isDefined, ceil10, asHalfPixel, diffDomain, isEmpty, notEmpty, getOption, hasValue, sanitise, getPathBox } from './util'; import { isValue, isFunction, isString, isUndefined, isDefined, ceil10, asHalfPixel, diffDomain, isEmpty, notEmpty, getOption, hasValue, sanitise, getPathBox } from './util';
@ -8,8 +9,6 @@ export var c3_chart_fn;
export var c3_chart_internal_fn; export var c3_chart_internal_fn;
export var c3_chart_internal_axis_fn; export var c3_chart_internal_axis_fn;
var d3 = window.d3 ? window.d3 : typeof require !== 'undefined' ? require("d3") : undefined;
export function API(owner) { export function API(owner) {
this.owner = owner; this.owner = owner;
} }
@ -50,7 +49,7 @@ function Chart(config) {
function ChartInternal(api) { function ChartInternal(api) {
var $$ = this; var $$ = this;
$$.d3 = d3 $$.d3 = d3;
$$.api = api; $$.api = api;
$$.config = $$.getDefaultConfig(); $$.config = $$.getDefaultConfig();
$$.data = {}; $$.data = {};
@ -1084,4 +1083,3 @@ c3_chart_internal_fn.hasValue = hasValue;
c3_chart_internal_fn.sanitise = sanitise; c3_chart_internal_fn.sanitise = sanitise;
c3_chart_internal_fn.getPathBox = getPathBox; c3_chart_internal_fn.getPathBox = getPathBox;
c3_chart_internal_fn.CLASS = CLASS; c3_chart_internal_fn.CLASS = CLASS;

4
src/index.js

@ -1,4 +1,4 @@
import { c3 } from './core' import { c3 } from './core';
import './polyfill'; import './polyfill';
@ -55,4 +55,4 @@ import './ua';
import './util'; import './util';
import './zoom'; import './zoom';
export default c3 export default c3;

1
src/title.js

@ -1,4 +1,3 @@
import CLASS from './class';
import { c3_chart_internal_fn } from './core'; import { c3_chart_internal_fn } from './core';
c3_chart_internal_fn.initTitle = function () { c3_chart_internal_fn.initTitle = function () {

Loading…
Cancel
Save