style: fix lint issues in code 🕺 (#626)

* style: fix lint issues in code 🕺

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* style: lint fix all files

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* chore: add `keywords` for better reach

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* feat: add `husky` & `commitlint`

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* chore: ignore `public` directory

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* revert: do not lint `public` directory

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* style: fix issues with lint

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* feat: add eslint config

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* feat: add lint-staged

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* style: lint fix all file(s)

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* fix: ignore rules for light version

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* fix: remove unnecessary space

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* chore(deps): update lockfile

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

* style: autofix linting issue(s)

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
This commit is contained in:
Vinayak Kulkarni
2022-11-09 09:26:07 +05:30
committed by GitHub
parent 50201f0a99
commit 9b64093c42
24 changed files with 8084 additions and 1264 deletions

View File

@@ -1,48 +1,48 @@
const testTileJSONArray = function(url) {
describe(url + ' is array of TileJSONs', function() {
it('is json', function(done) {
const testTileJSONArray = function (url) {
describe(url + ' is array of TileJSONs', function () {
it('is json', function (done) {
supertest(app)
.get(url)
.expect(200)
.expect('Content-Type', /application\/json/, done);
.get(url)
.expect(200)
.expect('Content-Type', /application\/json/, done);
});
it('is non-empty array', function(done) {
it('is non-empty array', function (done) {
supertest(app)
.get(url)
.expect(function(res) {
expect(res.body).to.be.a('array');
expect(res.body.length).to.be.greaterThan(0);
}).end(done);
.get(url)
.expect(function (res) {
expect(res.body).to.be.a('array');
expect(res.body.length).to.be.greaterThan(0);
})
.end(done);
});
});
};
const testTileJSON = function(url) {
describe(url + ' is TileJSON', function() {
it('is json', function(done) {
const testTileJSON = function (url) {
describe(url + ' is TileJSON', function () {
it('is json', function (done) {
supertest(app)
.get(url)
.expect(200)
.expect('Content-Type', /application\/json/, done);
.get(url)
.expect(200)
.expect('Content-Type', /application\/json/, done);
});
it('has valid tiles', function(done) {
it('has valid tiles', function (done) {
supertest(app)
.get(url)
.expect(function(res) {
expect(res.body.tiles.length).to.be.greaterThan(0);
}).end(done);
.get(url)
.expect(function (res) {
expect(res.body.tiles.length).to.be.greaterThan(0);
})
.end(done);
});
});
};
describe('Metadata', function() {
describe('/health', function() {
it('returns 200', function(done) {
supertest(app)
.get('/health')
.expect(200, done);
describe('Metadata', function () {
describe('/health', function () {
it('returns 200', function (done) {
supertest(app).get('/health').expect(200, done);
});
});
@@ -50,24 +50,25 @@ describe('Metadata', function() {
testTileJSONArray('/rendered.json');
testTileJSONArray('/data.json');
describe('/styles.json is valid array', function() {
it('is json', function(done) {
describe('/styles.json is valid array', function () {
it('is json', function (done) {
supertest(app)
.get('/styles.json')
.expect(200)
.expect('Content-Type', /application\/json/, done);
.get('/styles.json')
.expect(200)
.expect('Content-Type', /application\/json/, done);
});
it('contains valid item', function(done) {
it('contains valid item', function (done) {
supertest(app)
.get('/styles.json')
.expect(function(res) {
expect(res.body).to.be.a('array');
expect(res.body.length).to.be.greaterThan(0);
expect(res.body[0].version).to.be.equal(8);
expect(res.body[0].id).to.be.a('string');
expect(res.body[0].name).to.be.a('string');
}).end(done);
.get('/styles.json')
.expect(function (res) {
expect(res.body).to.be.a('array');
expect(res.body.length).to.be.greaterThan(0);
expect(res.body[0].version).to.be.equal(8);
expect(res.body[0].id).to.be.a('string');
expect(res.body[0].name).to.be.a('string');
})
.end(done);
});
});