Add coexistence checks to all enqueue methods to prevent loading both React and Grid.js assets simultaneously. Changes: - ReactAdmin.php: Only enqueue React assets when ?react=1 - Init.php: Skip Grid.js when React active on admin pages - Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0 - Customer.php, Product.php, License.php: Add coexistence checks Now the toggle between Classic and React versions works correctly. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
73 lines
1.5 KiB
JavaScript
73 lines
1.5 KiB
JavaScript
import globals from 'globals';
|
|
import jsdoc from './dist/index.js';
|
|
// import canonical from 'eslint-config-canonical';
|
|
// import canonicalJsdoc from 'eslint-config-canonical/jsdoc.js';
|
|
|
|
const common = {
|
|
linterOptions: {
|
|
reportUnusedDisableDirectives: 0
|
|
},
|
|
plugins: {
|
|
jsdoc
|
|
}
|
|
};
|
|
|
|
export default [
|
|
// canonical,
|
|
// canonicalJsdoc,
|
|
{
|
|
...common,
|
|
files: ['.ncurc.js'],
|
|
languageOptions: {
|
|
parserOptions: {
|
|
ecmaFeatures: {
|
|
impliedStrict: false
|
|
},
|
|
},
|
|
sourceType: 'script'
|
|
},
|
|
rules: {
|
|
'import/no-commonjs': 0,
|
|
strict: [
|
|
'error',
|
|
'global'
|
|
]
|
|
}
|
|
},
|
|
{
|
|
...common,
|
|
files: ['test/**/*.js'],
|
|
rules: {
|
|
'no-restricted-syntax': 0,
|
|
'unicorn/prevent-abbreviations': 0
|
|
}
|
|
},
|
|
{
|
|
...common,
|
|
ignores: ['dist/**/*.js', '.ignore/**/*.js'],
|
|
languageOptions: {
|
|
globals: globals.node
|
|
},
|
|
settings: {
|
|
jsdoc: {
|
|
mode: 'typescript'
|
|
}
|
|
},
|
|
rules: {
|
|
'array-element-newline': 0,
|
|
'filenames/match-regex': 0,
|
|
'import/extensions': 0,
|
|
'import/no-useless-path-segments': 0,
|
|
'prefer-named-capture-group': 0,
|
|
'unicorn/no-array-reduce': 0,
|
|
'unicorn/no-unsafe-regex': 0,
|
|
'unicorn/prefer-array-some': 0,
|
|
'unicorn/prevent-abbreviations': 0,
|
|
'unicorn/import-index': 0,
|
|
'linebreak-style': 0,
|
|
'no-inline-comments': 0,
|
|
'no-extra-parens': 0
|
|
}
|
|
}
|
|
];
|