Skip to content

Instantly share code, notes, and snippets.

View 43081j's full-sized avatar
💭
Diving into repos I don't know

James Garbutt 43081j

💭
Diving into repos I don't know
View GitHub Profile
@43081j
43081j / .mocharc.json
Last active February 1, 2024 16:06
mocha 10 + chai 5 + ts-node
{
"loader": "ts-node/esm",
"extensions": ["ts"],
"spec": [
"tests/*.ts"
]
}
@43081j
43081j / .eslintrc.json
Created June 28, 2021 07:29
Disallow `it.only` via ESLint
{
"rules": {
"no-restricted-syntax": [
"error",
{
"selector": "CallExpression[callee.object.type='Identifier'][callee.object.name='it'][callee.property.type='Identifier'][callee.property.name='only']",
"message": "it.only is only allowed during development"
}
]
}
import { Component, Prop } from '@stencil/core';
@Component({
tag: 'x-foo',
shadow: true
})
export class XFoo {
@Prop()
public flag: string = 'foo';
@43081j
43081j / karma.conf.js
Created August 23, 2017 14:16
Polymer + Webpack + Karma config
const webpackConfig = require('./webpack.config.js');
const webpack = require('webpack');
const path = require('path');
delete webpackConfig.entry;
webpackConfig.bail = false;
webpackConfig.stats = 'errors-only';
webpackConfig.plugins.push(new webpack.SourceMapDevToolPlugin({
filename: null,
test: /\.(ts|js)($|\?)/i
@43081j
43081j / es2015.md
Last active August 19, 2016 14:35
ES2015 and drafts/proposals vs. ES5

ES2015

arrow functions

Before:

[1,2,3,4].filter(function(i) {
	return i % 2 === 0;
});