Skip to content

Commit

Permalink
Set up linting and autoformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
incatrex committed Aug 12, 2021
1 parent 75d6d89 commit af7a482
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 37 deletions.
12 changes: 6 additions & 6 deletions client/.eslintrc.js
Expand Up @@ -3,19 +3,19 @@ module.exports = {
env: {
node: true,
},
extends: ["plugin:vue/essential", "eslint:recommended", "@vue/prettier"],
extends: ['plugin:vue/essential', 'eslint:recommended', '@vue/prettier'],
parserOptions: {
parser: "babel-eslint",
parser: 'babel-eslint',
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
},
overrides: [
{
files: [
"**/__tests__/*.{j,t}s?(x)",
"**/tests/unit/**/*.spec.{j,t}s?(x)",
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)',
],
env: {
jest: true,
Expand Down
6 changes: 6 additions & 0 deletions client/.prettierrc.js
@@ -0,0 +1,6 @@
module.exports = {
arrowParens: 'avoid',
bracketSpacing: false,
singleQuote: true,
trailingComma: 'all',
};
2 changes: 1 addition & 1 deletion client/babel.config.js
@@ -1,3 +1,3 @@
module.exports = {
presets: ["@vue/cli-plugin-babel/preset"],
presets: ['@vue/cli-plugin-babel/preset'],
};
2 changes: 1 addition & 1 deletion client/jest.config.js
@@ -1,3 +1,3 @@
module.exports = {
preset: "@vue/cli-plugin-unit-jest",
preset: '@vue/cli-plugin-unit-jest',
};
4 changes: 2 additions & 2 deletions client/src/App.vue
Expand Up @@ -6,10 +6,10 @@
</template>

<script>
import HelloWorld from "./components/HelloWorld.vue";
import HelloWorld from './components/HelloWorld.vue';
export default {
name: "App",
name: 'App',
components: {
HelloWorld,
},
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/HelloWorld.vue
Expand Up @@ -112,7 +112,7 @@

<script>
export default {
name: "HelloWorld",
name: 'HelloWorld',
props: {
msg: String,
},
Expand Down
10 changes: 5 additions & 5 deletions client/src/main.js
@@ -1,10 +1,10 @@
import Vue from "vue";
import App from "./App.vue";
import store from "./store";
import Vue from 'vue';
import App from './App.vue';
import store from './store';

Vue.config.productionTip = false;

new Vue({
store,
render: (h) => h(App),
}).$mount("#app");
render: h => h(App),
}).$mount('#app');
4 changes: 2 additions & 2 deletions client/src/store/index.js
@@ -1,5 +1,5 @@
import Vue from "vue";
import Vuex from "vuex";
import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

Expand Down
6 changes: 3 additions & 3 deletions client/tests/e2e/.eslintrc.js
@@ -1,10 +1,10 @@
module.exports = {
plugins: ["cypress"],
plugins: ['cypress'],
env: {
mocha: true,
"cypress/globals": true,
'cypress/globals': true,
},
rules: {
strict: "off",
strict: 'off',
},
};
10 changes: 5 additions & 5 deletions client/tests/e2e/plugins/index.js
Expand Up @@ -16,10 +16,10 @@ module.exports = (on, config) => {
// }))

return Object.assign({}, config, {
fixturesFolder: "tests/e2e/fixtures",
integrationFolder: "tests/e2e/specs",
screenshotsFolder: "tests/e2e/screenshots",
videosFolder: "tests/e2e/videos",
supportFile: "tests/e2e/support/index.js",
fixturesFolder: 'tests/e2e/fixtures',
integrationFolder: 'tests/e2e/specs',
screenshotsFolder: 'tests/e2e/screenshots',
videosFolder: 'tests/e2e/videos',
supportFile: 'tests/e2e/support/index.js',
});
};
8 changes: 4 additions & 4 deletions client/tests/e2e/specs/test.js
@@ -1,8 +1,8 @@
// https://docs.cypress.io/api/introduction/api.html

describe("My First Test", () => {
it("Visits the app root url", () => {
cy.visit("/");
cy.contains("h1", "Welcome to Your Vue.js App");
describe('My First Test', () => {
it('Visits the app root url', () => {
cy.visit('/');
cy.contains('h1', 'Welcome to Your Vue.js App');
});
});
2 changes: 1 addition & 1 deletion client/tests/e2e/support/index.js
Expand Up @@ -14,7 +14,7 @@
// ***********************************************************

// Import commands.js using ES2015 syntax:
import "./commands";
import './commands';

// Alternatively you can use CommonJS syntax:
// require('./commands')
12 changes: 6 additions & 6 deletions client/tests/unit/example.spec.js
@@ -1,11 +1,11 @@
import { shallowMount } from "@vue/test-utils";
import HelloWorld from "@/components/HelloWorld.vue";
import {shallowMount} from '@vue/test-utils';
import HelloWorld from '@/components/HelloWorld.vue';

describe("HelloWorld.vue", () => {
it("renders props.msg when passed", () => {
const msg = "new message";
describe('HelloWorld.vue', () => {
it('renders props.msg when passed', () => {
const msg = 'new message';
const wrapper = shallowMount(HelloWorld, {
propsData: { msg },
propsData: {msg},
});
expect(wrapper.text()).toMatch(msg);
});
Expand Down

0 comments on commit af7a482

Please sign in to comment.