2022-12-28 01:27:12 -08:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2023-05-09 22:21:01 -07:00
|
|
|
const path = require('path');
|
2023-05-04 08:11:04 -07:00
|
|
|
|
2022-12-28 01:27:12 -08:00
|
|
|
module.exports = {
|
2022-12-30 20:33:56 -08:00
|
|
|
root: true,
|
2023-05-09 22:21:01 -07:00
|
|
|
ignorePatterns: ['dist/**', 'tests/generated/**'],
|
|
|
|
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
|
|
|
|
plugins: ['prettier'],
|
2022-12-28 01:27:12 -08:00
|
|
|
rules: {
|
2023-05-09 22:21:01 -07:00
|
|
|
'no-var': 'error',
|
|
|
|
'prefer-arrow-callback': 'error',
|
|
|
|
'prefer-const': 'error',
|
|
|
|
'prefer-object-spread': 'error',
|
|
|
|
'prefer-spread': 'error',
|
|
|
|
'require-await': 'error',
|
2022-12-28 01:27:12 -08:00
|
|
|
},
|
|
|
|
env: {
|
|
|
|
commonjs: true,
|
2023-05-04 08:11:04 -07:00
|
|
|
es2018: true,
|
2022-12-28 01:27:12 -08:00
|
|
|
},
|
|
|
|
overrides: [
|
|
|
|
{
|
2023-05-09 22:21:01 -07:00
|
|
|
files: ['**/*.js'],
|
|
|
|
parser: '@babel/eslint-parser',
|
2023-05-04 08:11:04 -07:00
|
|
|
parserOptions: {
|
|
|
|
babelOptions: {
|
2023-05-09 22:21:01 -07:00
|
|
|
configFile: path.join(__dirname, '.babelrc.js'),
|
2023-05-04 08:11:04 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2023-05-09 22:21:01 -07:00
|
|
|
files: ['**/*.ts'],
|
|
|
|
extends: ['plugin:@typescript-eslint/recommended'],
|
|
|
|
parser: '@typescript-eslint/parser',
|
2023-05-04 08:11:04 -07:00
|
|
|
parserOptions: {
|
2023-05-09 22:21:01 -07:00
|
|
|
project: path.join(__dirname, 'tsconfig.json'),
|
2023-05-04 08:11:04 -07:00
|
|
|
},
|
2023-05-09 22:21:01 -07:00
|
|
|
plugins: ['@typescript-eslint'],
|
2023-05-04 08:11:04 -07:00
|
|
|
rules: {
|
2023-05-09 22:21:01 -07:00
|
|
|
'@typescript-eslint/no-var-requires': 'off',
|
2023-05-04 08:11:04 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2023-05-09 22:21:01 -07:00
|
|
|
files: ['**/.eslintrc.js', '**/just.config.js'],
|
2023-05-04 08:11:04 -07:00
|
|
|
env: {
|
|
|
|
node: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2023-05-09 22:21:01 -07:00
|
|
|
files: ['jest.*', 'tests/**'],
|
2022-12-28 01:27:12 -08:00
|
|
|
env: {
|
|
|
|
node: true,
|
|
|
|
},
|
2023-05-09 22:21:01 -07:00
|
|
|
extends: ['plugin:jest/recommended'],
|
2022-12-28 01:27:12 -08:00
|
|
|
globals: {
|
2023-05-09 22:21:01 -07:00
|
|
|
getMeasureCounter: 'writable',
|
|
|
|
getMeasureCounterMax: 'writable',
|
|
|
|
getMeasureCounterMin: 'writable',
|
|
|
|
Yoga: 'writable',
|
|
|
|
YGBENCHMARK: 'writable',
|
2022-12-28 01:27:12 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|