Skip to content

Instantly share code, notes, and snippets.

@agcty
agcty / package-nuxt.json
Last active December 3, 2018 22:05
Eslint config for Nuxt and VSCode
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/recommended",
"eslint:recommended",
"plugin:prettier/recommended",
"prettier/vue"
@agcty
agcty / package.json
Created December 3, 2018 22:07
Vue ESLint config
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/recommended",
"eslint:recommended",
"plugin:prettier/recommended",
"prettier/vue"
@agcty
agcty / .eslintrc
Created April 29, 2019 18:44
Sample .eslintrc with 4 spaces rule
{
"root": true,
"env": {
"node": true,
"jest": true
},
"extends": [
"plugin:vue/recommended",
"eslint:recommended",
"prettier/vue",
@agcty
agcty / .eslintrc-sample-file
Last active April 29, 2019 18:46
Add to Eslint for 4 spaces
"rules": {
"prettier/prettier": [
"error",
{
"singleQuote": false,
"tabWidth": 4
}
]
},
@agcty
agcty / jest.config.js
Last active May 17, 2019 15:23
Jest config
module.exports = {
// tell Jest to handle `*.vue` files
moduleFileExtensions: ["js", "json", "vue"],
watchman: false,
moduleNameMapper: {
"^~/(.*)$": "<rootDir>/$1",
"^~~/(.*)$": "<rootDir>/$1",
"^@/(.*)$": "<rootDir>/$1"
},
transform: {
@agcty
agcty / Logo.spec.js
Created May 19, 2019 14:29
Logo Jest test sample
import { shallowMount } from "@vue/test-utils";
import Logo from "../Logo";
const factory = () => {
return shallowMount(Logo, {
});
};
describe("Logo", () => {
@agcty
agcty / package.json
Last active December 21, 2019 16:25
Package file for Jest sample config
{
"name": "nuxt-jest",
"version": "1.0.0",
"description": "Nuxt jest sample config",
"author": "Alex Gogl",
"private": true,
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
@agcty
agcty / babel.config.js
Last active December 21, 2019 16:25
Babel config
function isBabelLoader(caller) {
return caller && caller.name === "babel-loader";
}
module.exports = function(api) {
if (api.env("test") && !api.caller(isBabelLoader)) {
return {
presets: [
[
"@babel/preset-env",
@agcty
agcty / settings.json
Last active December 26, 2019 11:47
VSCode settings file
{
"editor.formatOnSave": true,
"vetur.validation.template": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
@agcty
agcty / .eslintrc.js
Last active December 26, 2019 12:06
ESLint config file
module.exports = {
root: true,
env: {
node: true,
browser: true
},
extends: [
"plugin:vue/recommended",
"eslint:recommended",
"prettier/vue",