Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint errors #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/generator.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import fs from 'fs'
import path from 'path'

import { parse } from 'babylon'
import generateCode from '@babel/generator'
import _get from 'lodash.get'

import parser from './parser'
Expand Down
2 changes: 1 addition & 1 deletion test/examples/jsx.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import crates from '../../'
import crates from '../../src'

const component = (
<div>
Expand Down
2 changes: 1 addition & 1 deletion test/examples/vanilla.module.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import crates from '../../'
import crates from '../../src'

console.info(crates('Hello ', 'World!!!'))

Expand Down
2 changes: 1 addition & 1 deletion test/examples/vanilla.script.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const crates = require('../../')
const crates = require('../../src')

console.info(crates('Hello ', 'World!!!'))

Expand Down
6 changes: 3 additions & 3 deletions test/parser.jsx.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ describe('run parser on JSX file', () => {
})

test('to test, the translations must have 1 or more elements', async () => {
const translations = await parser(file, { moduleName: '../../' })
const translations = await parser(file, { moduleName: '../../src' })
expect(translations.size).toBeGreaterThan(1)
})

test('parser function should return a map with strings to translate', async () => {
const translations = await parser(file, { moduleName: '../../' })
const translations = await parser(file, { moduleName: '../../src' })
expect(translations).toBeInstanceOf(Map)
})

test("the map's keys must be equal to value", async () => {
const translations = await parser(file, { moduleName: '../../' })
const translations = await parser(file, { moduleName: '../../src' })
translations.forEach((value, key) => {
expect(key).toEqual(value)
})
Expand Down
12 changes: 6 additions & 6 deletions test/parser.vanilla.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ describe('run parser on vanilla-module file', () => {
})

test('to test, the translations must have 1 or more elements', async () => {
const translations = await parser(file, { moduleName: '../../' })
const translations = await parser(file, { moduleName: '../../src' })
expect(translations.size).toBeGreaterThan(1)
})

test('parser function should return a map with strings to translate', async () => {
const translations = await parser(file, { moduleName: '../../' })
const translations = await parser(file, { moduleName: '../../src' })
expect(translations).toBeInstanceOf(Map)
})

test("the map's keys must be equal to value", async () => {
const translations = await parser(file, { moduleName: '../../' })
const translations = await parser(file, { moduleName: '../../src' })
translations.forEach((value, key) => {
expect(key).toEqual(value)
})
Expand All @@ -40,17 +40,17 @@ describe('run parser on vanilla-script file', () => {
})

test('to test, the translations must have 1 or more elements', async () => {
const translations = await parser(file, { moduleName: '../../' })
const translations = await parser(file, { moduleName: '../../src' })
expect(translations.size).toBeGreaterThan(1)
})

test('parser function should return a map with strings to translate', async () => {
const translations = await parser(file, { moduleName: '../../' })
const translations = await parser(file, { moduleName: '../../src' })
expect(translations).toBeInstanceOf(Map)
})

test("the map's keys must be equal to value", async () => {
const translations = await parser(file, { moduleName: '../../' })
const translations = await parser(file, { moduleName: '../../src' })
translations.forEach((value, key) => {
expect(key).toEqual(value)
})
Expand Down