mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
5b61c8a56f
* refactor - file extenstion change to .ts * fix - imports syntax * fix - migration complete * fix - lint:prettier warn * refactor - validate-keys in tools/scripts/lint/ * refactor - validate-keys.ts moved to tools/scripts/lint and added in tsconfig.json * refactor - tsconfig.json file for tools * fix - lint:ts script update and validate-keys.js added to .eslintignore * fix - lint:prettier and ts compilation * fix - ts compilation * refactor - changes in .gitignore and validate-keys script
118 lines
2.7 KiB
JSON
118 lines
2.7 KiB
JSON
{
|
|
"env": {
|
|
"es6": true,
|
|
"browser": true,
|
|
"mocha": true,
|
|
"node": true,
|
|
"jest": true
|
|
},
|
|
"parser": "babel-eslint",
|
|
"root": true,
|
|
"extends": [
|
|
"./.eslintrc-base.json",
|
|
"plugin:import/typescript",
|
|
"plugin:jsx-a11y/recommended",
|
|
"prettier"
|
|
],
|
|
"plugins": [
|
|
"react",
|
|
"import",
|
|
"prefer-object-spread",
|
|
"react-hooks",
|
|
"jsx-a11y",
|
|
"jest-dom",
|
|
"testing-library"
|
|
],
|
|
"globals": {
|
|
"Promise": true,
|
|
"window": true,
|
|
"$": true,
|
|
"ga": true,
|
|
"jQuery": true,
|
|
"router": true
|
|
},
|
|
"settings": {
|
|
"react": {
|
|
"version": "16.4.2",
|
|
"import/ignore": ["\\.json$"],
|
|
"import/extensions": [".js", ".jsx", ".tsx", ".ts"]
|
|
},
|
|
"import/ignore": ["node_modules"]
|
|
},
|
|
"overrides": [
|
|
{
|
|
"files": ["**/*.ts?(x)"],
|
|
"parser": "@typescript-eslint/parser",
|
|
"parserOptions": {
|
|
"project": [
|
|
"./tsconfig.json",
|
|
"./tools/ui-components/tsconfig.json",
|
|
"./tools/tsconfig.json"
|
|
]
|
|
},
|
|
"extends": [
|
|
"plugin:@typescript-eslint/recommended",
|
|
"plugin:@typescript-eslint/recommended-requiring-type-checking"
|
|
],
|
|
"plugins": ["@typescript-eslint"],
|
|
"rules": {
|
|
"@typescript-eslint/naming-convention": [
|
|
"error",
|
|
{
|
|
"selector": "default",
|
|
"format": ["camelCase"],
|
|
"leadingUnderscore": "allow",
|
|
"trailingUnderscore": "allow"
|
|
},
|
|
|
|
{
|
|
"selector": "variable",
|
|
"format": ["camelCase", "UPPER_CASE", "PascalCase"],
|
|
"leadingUnderscore": "allowSingleOrDouble",
|
|
"trailingUnderscore": "allow"
|
|
},
|
|
{
|
|
"selector": "typeLike",
|
|
"format": ["PascalCase"],
|
|
"custom": {
|
|
"regex": "^I[A-Z]|[a-zA-Z]Type$",
|
|
"match": false
|
|
}
|
|
},
|
|
{
|
|
"selector": "typeProperty",
|
|
"format": ["camelCase", "PascalCase"]
|
|
},
|
|
{
|
|
"selector": "objectLiteralProperty",
|
|
"format": ["camelCase", "PascalCase"],
|
|
"leadingUnderscore": "allowSingleOrDouble"
|
|
},
|
|
{
|
|
"selector": "function",
|
|
"format": ["camelCase", "PascalCase"]
|
|
},
|
|
{
|
|
"selector": "enumMember",
|
|
"format": ["PascalCase"]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"files": [
|
|
"./tools/ui-components/**/*.test.[jt]s?(x)",
|
|
"./client/**/*.test.[jt]s?(x)"
|
|
],
|
|
"extends": ["plugin:testing-library/react", "plugin:jest-dom/recommended"]
|
|
},
|
|
{
|
|
"files": ["cypress/**/*.js"],
|
|
"globals": {
|
|
"cy": true,
|
|
"Cypress": true
|
|
}
|
|
}
|
|
]
|
|
}
|