Unify ESLint and Prettier across xplat/yoga
(#1335)
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1335 Reviewed By: christophpurrer Differential Revision: D47459866 fbshipit-source-id: fd6b4e4e2518d91968ac7180b32129b3f70edf88
This commit is contained in:
committed by
Facebook GitHub Bot
parent
05b2edfb85
commit
44507ec62e
76
.eslintrc.js
Normal file
76
.eslintrc.js
Normal file
@@ -0,0 +1,76 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
ignorePatterns: [
|
||||
'/website',
|
||||
'**/binaries/**',
|
||||
'**/build/**',
|
||||
'**/generated/**',
|
||||
],
|
||||
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
|
||||
plugins: ['prettier'],
|
||||
rules: {
|
||||
'no-unused-vars': ['error', {argsIgnorePattern: '^_'}],
|
||||
'no-var': 'error',
|
||||
'prefer-arrow-callback': 'error',
|
||||
'prefer-const': 'error',
|
||||
'prefer-object-spread': 'error',
|
||||
'prefer-spread': 'error',
|
||||
'require-await': 'error',
|
||||
},
|
||||
env: {
|
||||
commonjs: true,
|
||||
es2018: true,
|
||||
},
|
||||
parserOptions: {
|
||||
sourceType: 'module',
|
||||
ecmaVersion: 'latest',
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ['**/*.ts', '**/*.tsx'],
|
||||
extends: ['plugin:@typescript-eslint/recommended'],
|
||||
parser: '@typescript-eslint/parser',
|
||||
parserOptions: {
|
||||
project: true,
|
||||
},
|
||||
plugins: ['@typescript-eslint'],
|
||||
rules: {
|
||||
'@typescript-eslint/ban-ts-comment': 'off',
|
||||
'@typescript-eslint/no-unused-vars': [
|
||||
'error',
|
||||
{argsIgnorePattern: '^_'},
|
||||
],
|
||||
'@typescript-eslint/no-var-requires': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/.eslintrc.js', '**/just.config.js'],
|
||||
env: {
|
||||
node: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['jest.*', '**/tests/**'],
|
||||
env: {
|
||||
node: true,
|
||||
},
|
||||
extends: ['plugin:jest/recommended'],
|
||||
globals: {
|
||||
getMeasureCounter: 'writable',
|
||||
getMeasureCounterMax: 'writable',
|
||||
getMeasureCounterMin: 'writable',
|
||||
Yoga: 'writable',
|
||||
YGBENCHMARK: 'writable',
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
Reference in New Issue
Block a user