Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* LICENSE file in the root directory of this source tree.
*
* @format
*/
const typescriptEslintRecommended = require('@typescript-eslint/eslint-plugin/dist/configs/recommended.json');
const typescriptEslintPrettier = require('eslint-config-prettier/@typescript-eslint');
module.exports = {
extends: ['@react-native-community'],
overrides: [
{
files: ['*.ts', '*.tsx'],
// Apply the recommended Typescript defaults and the prettier overrides to all Typescript files
rules: Object.assign(
typescriptEslintRecommended.rules,
typescriptEslintPrettier.rules,
{
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'react-native/no-inline-styles': 'off',
},
),
},
],
};
files: ['*.ts'],
parser: '@typescript-eslint/parser',
// NOTE: Workaround for no nested extends possible.
// See https://github.com/eslint/eslint/issues/8813.
// Working solution would be following, if we had nested extends:
// ```
// extends: [
// 'airbnb-base',
// 'plugin:@typescript-eslint/recommended',
// 'prettier/@typescript-eslint',
// 'prettier',
// ],
// ```
plugins: ['@typescript-eslint', 'prettier'],
rules: Object.assign(
typescriptEslintRecommended.rules,
typescriptEslintPrettier.rules,
{
'@typescript-eslint/explicit-function-return-type': 'error',
},
),
},
],
};
* LICENSE file in the root directory of this source tree.
*
* @format
*/
const typescriptEslintRecommended = require('@typescript-eslint/eslint-plugin/dist/configs/recommended.json');
const typescriptEslintPrettier = require('eslint-config-prettier/@typescript-eslint');
module.exports = {
extends: ['@react-native-community'],
overrides: [
{
files: ['*.ts', '*.tsx'],
// Apply the recommended Typescript defaults and the prettier overrides to all Typescript files
rules: Object.assign(
typescriptEslintRecommended.rules,
typescriptEslintPrettier.rules,
{
'@typescript-eslint/explicit-member-accessibility': 'off',
},
),
},
{
files: ['example/**/*.ts', 'example/**/*.tsx'],
rules: {
// Turn off rules which are useless and annoying for the example files files
'@typescript-eslint/explicit-function-return-type': 'off',
'react-native/no-inline-styles': 'off',
},
},
{
files: ['**/__tests__/**/*.ts', '**/*.spec.ts'],
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
// NOTE: Workaround for no nested extends possible.
// See https://github.com/eslint/eslint/issues/8813.
// Working solution would be following, if we had nested extends:
// ```
// extends: [
// 'airbnb-base',
// 'plugin:@typescript-eslint/recommended',
// 'prettier/@typescript-eslint',
// 'prettier',
// ],
// ```
plugins: ['@typescript-eslint', 'prettier'],
rules: Object.assign(
typescriptEslintRecommended.rules,
typescriptEslintPrettier.rules,
{
'@typescript-eslint/explicit-function-return-type': 'error',
},
),
},
{
files: [
'setupTest.js',
'setupTest.ts',
'*.spec.js',
'*.spec.ts',
'*.spec.tsx',
],
env: {
jest: true,
const typescriptEslintRecommended = require('@typescript-eslint/eslint-plugin/dist/configs/recommended.json');
const typescriptEslintPrettier = require('eslint-config-prettier/@typescript-eslint');
module.exports = {
extends: ['@react-native-community'],
overrides: [
{
files: ['./mock.js'],
env: {jest: true},
},
{
files: ['*.ts', '*.tsx'],
// Apply the recommended Typescript defaults and the prettier overrides to all Typescript files
rules: Object.assign(
typescriptEslintRecommended.rules,
typescriptEslintPrettier.rules,
{
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/no-empty-function': 'off',
},
),
},
{
files: ['example/**/*.ts', 'example/**/*.tsx'],
rules: {
// Turn off rules which are useless and annoying for the example files files
'@typescript-eslint/explicit-function-return-type': 'off',
'react-native/no-inline-styles': 'off',
},
},
],
},
},
plugins: [
"@typescript-eslint",
"@typescript-eslint/tslint",
"react",
"jsx-a11y",
],
settings: {
react: {
version: "detect",
}
},
rules: Object.assign(
typescriptEslintRecommended.rules,
typescriptRecommended.rules,
typescriptEslintPrettier.rules,
react.rules,
jsxA11y.rules,
reactPrettier.rules,
{
"@typescript-eslint/adjacent-overload-signatures": "error",
// TODO: (cvle) change `readonly` param to `array-simple` when upgraded typescript.
"@typescript-eslint/array-type": ["error", { "default": "array-simple", "readonly": "generic"}],
"@typescript-eslint/ban-types": "error",
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/class-name-casing": "error",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": [
"error",