2020-06-12 20:03:43 +00:00
|
|
|
// License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
|
|
|
|
// Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
2020-06-29 20:54:35 +00:00
|
|
|
const _ = require('lodash');
|
|
|
|
|
|
|
|
const tsSpecBase = {
|
|
|
|
parser: '@typescript-eslint/parser',
|
|
|
|
plugins: [
|
|
|
|
'@typescript-eslint',
|
|
|
|
'jest'
|
|
|
|
],
|
|
|
|
extends: [
|
|
|
|
'eslint:recommended',
|
|
|
|
'plugin:@typescript-eslint/recommended',
|
|
|
|
'plugin:jest/all'
|
|
|
|
],
|
2020-06-29 21:01:52 +00:00
|
|
|
rules: {
|
|
|
|
"jest/lowercase-name": ["error", { "ignore": ["describe"] }]
|
2020-06-29 20:54:35 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-06-29 21:01:52 +00:00
|
|
|
|
2020-06-29 20:54:35 +00:00
|
|
|
const tsSpec = _.cloneDeep(tsSpecBase);
|
|
|
|
tsSpec['files'] = ['**/*.spec.ts'];
|
2020-06-26 21:50:19 +00:00
|
|
|
|
2020-06-29 21:01:52 +00:00
|
|
|
const tsxSpec = _.cloneDeep(tsSpecBase);
|
|
|
|
tsxSpec['files'] = ['**/*.spec.tsx'];
|
|
|
|
tsxSpec['plugins'] = [...tsxSpec['plugins'], "react"];
|
|
|
|
tsxSpec['extends'] = [...tsxSpec['extends'], "plugin:react/recommended"];
|
|
|
|
|
|
|
|
|
|
|
|
const tsBase = {
|
|
|
|
parser: '@typescript-eslint/parser',
|
|
|
|
plugins: [
|
|
|
|
'@typescript-eslint',
|
|
|
|
],
|
|
|
|
extends: [
|
|
|
|
'eslint:recommended',
|
|
|
|
'plugin:@typescript-eslint/recommended',
|
|
|
|
"plugin:react-hooks/recommended",
|
|
|
|
]
|
|
|
|
};
|
|
|
|
|
|
|
|
const tsSettings = _.cloneDeep(tsBase);
|
|
|
|
tsSettings['files'] = ['**/*.ts'];
|
|
|
|
|
|
|
|
const tsxSettings = _.cloneDeep(tsBase);
|
|
|
|
tsxSettings['files'] = ['**/*.tsx'];
|
2020-06-26 21:50:19 +00:00
|
|
|
|
2018-03-25 17:30:42 +00:00
|
|
|
module.exports = {
|
2020-06-26 21:50:19 +00:00
|
|
|
root: true,
|
|
|
|
|
|
|
|
overrides: [
|
|
|
|
{
|
2020-06-29 20:54:35 +00:00
|
|
|
"files": ['*.js', 'config/webpack/**/*.js'],
|
2020-06-26 21:50:19 +00:00
|
|
|
extends: [
|
|
|
|
'eslint:recommended',
|
2020-06-29 20:54:35 +00:00
|
|
|
'plugin:node/recommended'
|
|
|
|
],
|
2020-06-27 00:47:37 +00:00
|
|
|
},
|
2020-06-29 21:01:52 +00:00
|
|
|
tsSpec,
|
|
|
|
tsxSpec,
|
|
|
|
tsSettings,
|
|
|
|
tsxSettings
|
2020-06-26 21:50:19 +00:00
|
|
|
],
|
|
|
|
"rules": {
|
|
|
|
"linebreak-style": [
|
|
|
|
"error",
|
|
|
|
"unix"
|
|
|
|
],
|
|
|
|
"semi": [
|
|
|
|
"error",
|
2020-06-26 23:18:41 +00:00
|
|
|
"always"
|
2020-06-27 00:47:37 +00:00
|
|
|
],
|
|
|
|
"no-trailing-spaces": ["error"],
|
|
|
|
"indent": ["error", "tab"], // we use tabs for accessibility
|
2020-06-29 21:01:52 +00:00
|
|
|
},
|
|
|
|
"settings": {
|
|
|
|
"react": {
|
|
|
|
"version": "detect"
|
|
|
|
},
|
2020-06-26 21:50:19 +00:00
|
|
|
}
|
2018-03-25 17:30:42 +00:00
|
|
|
};
|