Skip to content
This repository has been archived by the owner on Jul 7, 2022. It is now read-only.

Commit

Permalink
feat(config): Update config files
Browse files Browse the repository at this point in the history
Update config files to match my projects needs instead of the originals from kcd-scripts
  • Loading branch information
adambrgmn committed Nov 29, 2017
1 parent 1576d12 commit bdd4c44
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions src/config/__tests__/lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-use-before-define */
import * as utilsMock from '../../utils';

jest.mock('../../utils', () => ({
Expand Down
7 changes: 3 additions & 4 deletions src/config/eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ const { ifAnyDep } = require('../utils');

module.exports = {
extends: [
require.resolve('eslint-config-kentcdodds'),
require.resolve('eslint-config-kentcdodds/jest'),
ifAnyDep('react', require.resolve('eslint-config-kentcdodds/jsx-a11y')),
ifAnyDep('react', require.resolve('eslint-config-kentcdodds/react')),
require.resolve('eslint-config-airbnb-base'),
ifAnyDep('react', require.resolve('eslint-config-airbnb')),
require.resolve('eslint-config-prettier'),
].filter(Boolean),
rules: {},
};
2 changes: 1 addition & 1 deletion src/config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const jestConfig = {
roots: [fromRoot('src')],
testEnvironment: ifAnyDep(['webpack', 'rollup', 'react'], 'jsdom', 'node'),
collectCoverageFrom: ['src/**/*.js'],
testMatch: ['**/__tests__/**/*.js'],
testMatch: ['**/__tests__/**/*.js?(x)', '**/?(*.)(spec|test).js?(x)'],
testPathIgnorePatterns: [...ignores],
coveragePathIgnorePatterns: [...ignores, 'src/(umd|cjs|esm)-entry.js$'],
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$'],
Expand Down
14 changes: 7 additions & 7 deletions src/config/lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
const { resolveKcdScripts, resolveBin, isOptedOut } = require('../utils');
const { resolveFransScripts, resolveBin, isOptedOut } = require('../utils');

const kcdScripts = resolveKcdScripts();
const fransScripts = resolveFransScripts();
const doctoc = resolveBin('doctoc');

module.exports = {
concurrent: false,
linters: {
'README.md': [`${doctoc} --maxlevel 3 --notitle`, 'git add'],
'.all-contributorsrc': [
`${kcdScripts} contributors generate`,
`${fransScripts} contributors generate`,
'git add README.md',
],
'**/*.+(js|json|less|css|ts|md)': [
isOptedOut('autoformat', null, `${kcdScripts} format`),
`${kcdScripts} lint`,
`${kcdScripts} test --findRelatedTests`,
'**/*.+(js|jsx|json|less|scss|sass|css|ts|md)': [
isOptedOut('autoformat', null, `${fransScripts} format`),
`${fransScripts} lint`,
`${fransScripts} test --findRelatedTests`,
isOptedOut('autoformat', null, 'git add'),
].filter(Boolean),
},
Expand Down
1 change: 1 addition & 0 deletions src/config/prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ node_modules/
coverage/
dist/
build/
!src/scripts/build
out/
.next/
8 changes: 4 additions & 4 deletions src/config/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ const isNode = parseEnv('BUILD_NODE', false);
const name = process.env.BUILD_NAME || capitalize(camelcase(pkg.name));

const defaultGlobals = Object.keys(pkg.peerDependencies || {}).reduce(
(deps, dep) => {
deps[dep] = capitalize(camelcase(dep));
return deps;
},
(deps, dep) =>
Object.assign({}, deps, {
[dep]: capitalize(camelcase(dep)),
}),
{},
);

Expand Down

0 comments on commit bdd4c44

Please sign in to comment.