Skip to content

Commit 405e4f0

Browse files
author
codeliner
committed
Configure QA tools
1 parent 93594eb commit 405e4f0

7 files changed

Lines changed: 158 additions & 0 deletions

File tree

.eslintignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
__fixtures__
2+
dist
3+
node_modules
4+
.yarn
5+
build
6+
coverage
7+
jest.config.js
8+
jest.transform.js
9+
scripts
10+
examples/

.eslintrc.js

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/**
2+
* Copyright (c) Facebook, Inc. and its affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
const OFF = 0;
9+
const WARNING = 1;
10+
const ERROR = 2;
11+
12+
module.exports = {
13+
root: true,
14+
env: {
15+
browser: true,
16+
commonjs: true,
17+
jest: true,
18+
node: true,
19+
},
20+
parser: '@typescript-eslint/parser',
21+
parserOptions: {
22+
allowImportExportEverywhere: true,
23+
},
24+
globals: {
25+
testStylelintRule: true,
26+
},
27+
extends: [
28+
'eslint:recommended',
29+
'plugin:@typescript-eslint/eslint-recommended',
30+
'plugin:@typescript-eslint/recommended',
31+
'plugin:react-hooks/recommended',
32+
'airbnb',
33+
'prettier',
34+
],
35+
settings: {
36+
'import/resolver': {
37+
node: {
38+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
39+
},
40+
},
41+
},
42+
plugins: ['react-hooks'],
43+
rules: {
44+
'import/extensions': OFF,
45+
'no-use-before-define': OFF,
46+
'react/jsx-filename-extension': OFF,
47+
'jsx-a11y/anchor-is-valid': OFF,
48+
'no-console': OFF,
49+
'global-require': WARNING,
50+
'react/jsx-props-no-spreading': OFF,
51+
'import/no-unresolved': [
52+
ERROR,
53+
{
54+
ignore: [
55+
'^@lib',
56+
'^@hooks',
57+
'^@/hooks',
58+
'^@/components',
59+
'@/lib',
60+
'@/utils',
61+
'@/types',
62+
],
63+
},
64+
],
65+
'react/react-in-jsx-scope': OFF,
66+
'no-param-reassign': [WARNING, { props: false }],
67+
'no-undef': OFF,
68+
'@typescript-eslint/no-namespace': OFF,
69+
'import/no-extraneous-dependencies': OFF,
70+
'jsx-a11y/label-has-associated-control': OFF,
71+
'react/no-array-index-key': OFF,
72+
'@typescript-eslint/no-explicit-any': OFF, // for now...
73+
'react/require-default-props': [ERROR, { ignoreFunctionalComponents: true }],
74+
'@typescript-eslint/ban-ts-comment': OFF,
75+
'react/function-component-definition': [
76+
WARNING,
77+
{
78+
namedComponents: 'function-declaration',
79+
unnamedComponents: 'arrow-function',
80+
},
81+
],
82+
},
83+
};

.prettierignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
dist
2+
node_modules
3+
.yarn
4+
build
5+
coverage
6+
packages/cody-*/lib/*
7+
__fixtures__
8+
examples/

.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"printWidth": 130,
5+
"tabWidth": 2,
6+
"useTabs": false,
7+
"trailingComma": "es5",
8+
"bracketSpacing": true
9+
}

babel.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
presets: [
3+
[
4+
'@babel/env',
5+
{
6+
targets: {
7+
node: 'current',
8+
},
9+
},
10+
],
11+
'@babel/preset-typescript',
12+
],
13+
};

jest.config.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
const path = require('path');
3+
4+
const ignorePatterns = [
5+
'/node_modules/',
6+
'__fixtures__',
7+
'/packages/cody-types/lib',
8+
];
9+
10+
module.exports = {
11+
rootDir: path.resolve(__dirname),
12+
verbose: true,
13+
testURL: 'http://localhost/',
14+
testEnvironment: 'node',
15+
testPathIgnorePatterns: ignorePatterns,
16+
coveragePathIgnorePatterns: ignorePatterns,
17+
transform: {
18+
'^.+\\.[jt]sx?$': 'babel-jest',
19+
},
20+
};

tsconfig.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"declaration": true,
5+
"noImplicitAny": false,
6+
"removeComments": true,
7+
"noLib": false,
8+
"emitDecoratorMetadata": true,
9+
"experimentalDecorators": true,
10+
"target": "es6",
11+
"sourceMap": true,
12+
"lib": ["es6"]
13+
},
14+
"exclude": ["node_modules", "**/*.test.ts"]
15+
}

0 commit comments

Comments
 (0)