Skip to content

Commit

Permalink
refactor(*): refactor with tyepscript
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcc committed Aug 20, 2019
1 parent 047fb21 commit f8bb324
Show file tree
Hide file tree
Showing 68 changed files with 1,000 additions and 2,315 deletions.
11 changes: 0 additions & 11 deletions .babelrc

This file was deleted.

7 changes: 0 additions & 7 deletions .eslintignore

This file was deleted.

40 changes: 0 additions & 40 deletions .eslintrc

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ temp
.idea
demos/assets/screenshots
lib
esm

*.sw*
*.un~
77 changes: 0 additions & 77 deletions .npmignore

This file was deleted.

8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"printWidth": 120,
"arrowParens": "always"
}
13 changes: 8 additions & 5 deletions .torch.compile.opts.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
module.exports = {
babelrc: {
presets: [
'@babel/preset-env'
'@babel/env'
],
sourceMaps: 'inline'
},
extensions: ['.js'],
extensions: ['.es6', '.es', '.jsx', '.js', '.ts'],
include: [
'node_modules/**/src/gl-matrix/**/*.js '
'src/**',
'lib/**',
'__tests__/**',
],
exclude: [
'bower_components/**/*.js',
'bower_components/**',
'node_modules/**'
]
}
};
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# adjust
# @antv/adjust

[![](https://img.shields.io/travis/antvis/adjust.svg)](https://travis-ci.org/antvis/adjust)
![](https://img.shields.io/badge/language-javascript-red.svg)
Expand Down
8 changes: 8 additions & 0 deletions __tests__/bugs/issue-1-spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { expect } from 'chai';
import * as adjust from '../../src';

describe('#1', () => {
it('description', () => {
expect(adjust).to.be.an('object');
});
});
29 changes: 15 additions & 14 deletions test/unit/adjust-spec.js → __tests__/unit/adjust-spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const expect = require('chai').expect;
const Adjust = require('../../src/index');
import { expect } from 'chai';
import Adjust from '../../src/adjusts/adjust';

describe('adjust', function() {

const data = [
Expand All @@ -8,13 +9,13 @@ describe('adjust', function() {
{ a: 2, b: 1 },
{ a: 2, b: 4 },
{ a: 3, b: 5 },
{ a: 3, b: 1 }
{ a: 3, b: 1 },
];

describe('default adjust', function() {
const adjust = new Adjust({
xField: 'a',
yField: 'b'
yField: 'b',
});

it('is adjust', function() {
Expand Down Expand Up @@ -52,7 +53,7 @@ describe('adjust', function() {
describe('only adjust x', function() {
const adjust = new Adjust({
xField: 'a',
adjustNames: [ 'x' ]
adjustNames: [ 'x' ],
});

it('is adjust', function() {
Expand All @@ -70,7 +71,7 @@ describe('adjust', function() {
describe('only x adjust x,y', function() {
const adjust = new Adjust({
xField: 'a',
adjustNames: [ 'x', 'y' ]
adjustNames: [ 'x', 'y' ],
});

it('is adjust', function() {
Expand All @@ -91,13 +92,13 @@ describe('adjust', function() {

});
describe('one record adjust', function() {
const data = [{
const data = [ {
a: 1,
b: 2
}];
b: 2,
} ];
const adjust = new Adjust({
yField: 'a',
adjustNames: [ 'y' ]
adjustNames: [ 'y' ],
});

it('get adjust values', function() {
Expand All @@ -117,13 +118,13 @@ describe('adjust', function() {


describe('only x adjust y', function() {
const data = [{
const data = [ {
a: 1,
b: 2
}];
b: 2,
} ];
const adjust = new Adjust({
xField: 'a',
adjustNames: [ 'y' ]
adjustNames: [ 'y' ],
});

it('get adjust values', function() {
Expand Down
Loading

0 comments on commit f8bb324

Please sign in to comment.