silphius/.eslintrc.cjs

91 lines
1.7 KiB
JavaScript
Raw Normal View History

2024-06-10 14:47:05 -05:00
/**
* This is intended to be a basic starting point for linting in your app.
* It relies on recommended configs out of the box for simplicity, but you can
* and should modify this configuration to best suit your team's needs.
*/
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
parserOptions: {
2024-06-10 19:35:19 -05:00
ecmaVersion: 'latest',
sourceType: 'module',
2024-06-10 14:47:05 -05:00
ecmaFeatures: {
jsx: true,
},
},
env: {
browser: true,
commonjs: true,
es6: true,
},
2024-06-12 23:17:24 -05:00
globals: {
process: false,
},
2024-06-10 19:35:19 -05:00
ignorePatterns: ['!**/.server', '!**/.client'],
2024-06-10 14:47:05 -05:00
// Base config
2024-06-10 19:35:19 -05:00
extends: ['eslint:recommended'],
2024-06-23 07:35:56 -05:00
rules: {
'no-constant-condition': ['error', {checkLoops: false}],
},
2024-06-10 14:47:05 -05:00
overrides: [
2024-06-16 08:01:01 -05:00
// Tests
{
files: ['**/*.test.{js,jsx,ts,tsx}'],
rules: {
'no-empty-pattern': 'off',
},
},
2024-06-10 14:47:05 -05:00
// React
{
2024-06-27 11:06:58 -05:00
files: ['**/*.{jsx,tsx}'],
2024-06-10 19:35:19 -05:00
plugins: ['react', 'jsx-a11y'],
2024-06-10 14:47:05 -05:00
extends: [
2024-06-10 19:35:19 -05:00
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'plugin:jsx-a11y/recommended',
2024-06-10 14:47:05 -05:00
],
settings: {
react: {
2024-06-10 19:35:19 -05:00
version: 'detect',
2024-06-10 14:47:05 -05:00
},
2024-06-10 19:35:19 -05:00
formComponents: ['Form'],
2024-06-10 14:47:05 -05:00
linkComponents: [
2024-06-10 19:35:19 -05:00
{ name: 'Link', linkAttribute: 'to' },
{ name: 'NavLink', linkAttribute: 'to' },
2024-06-10 14:47:05 -05:00
],
},
rules: {
2024-06-10 19:35:19 -05:00
'react/prop-types': 'off',
2024-06-10 14:47:05 -05:00
},
},
// Node
{
2024-06-12 23:17:24 -05:00
files: [
'app/websocket.js',
'.eslintrc.cjs',
'server.js',
'vite.config.js',
],
2024-06-10 14:47:05 -05:00
env: {
node: true,
},
},
2024-06-21 04:55:07 -05:00
// Assets
{
files: [
2024-09-17 01:25:39 -05:00
'resources/**/*.js',
2024-06-21 04:55:07 -05:00
],
rules: {
2024-06-25 05:28:41 -05:00
'no-undef': 0,
2024-06-21 04:55:07 -05:00
},
}
2024-06-10 14:47:05 -05:00
],
};