Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ module.exports = {
},
},
{
files: ['packages/plugins/theme-*/**/*'],
files: [
'packages/plugins/theme-*/**/*',
'packages/plugins/dev-tools/**/*'
],
options: {
// Some properties must be quoted to preserve closure compiler behavior.
// If at least one property in an object requires quotes, quote all
Expand Down
90 changes: 55 additions & 35 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
import {defineConfig} from 'eslint/config';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import eslintConfigPrettier from 'eslint-config-prettier';

// These rules are no longer supported, but the Google style package we depend
// on hasn't been updated in years to remove them, even though they have been
Expand Down Expand Up @@ -139,6 +140,11 @@ export default defineConfig(
{
// Note: there should be no other properties in this object
ignores: [
// All Packages
'packages/*/node_modules/**',
'packages/**/build/',
'packages/**/dist/',
// Core Build artifacts
// All Packages
'packages/*/node_modules/**',
'packages/**/build/',
Expand Down Expand Up @@ -174,45 +180,13 @@ export default defineConfig(
jsdoc.configs['flat/recommended'],
{
files: ['packages/blockly/**/*.ts', 'packages/blockly/**/*.tsx', 'packages/blockly/**/*.js'],
extends: [eslint.configs.recommended, googleStyle],
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
settings: {
// Allowlist some JSDoc tag aliases we use.
'jsdoc': {
'tagNamePreference': {
'return': 'return',
'fileoverview': 'fileoverview',
'extends': 'extends',
'constructor': 'constructor',
},
},
},
rules,
// Per the docs, this should be at the end because it disables rules that
// conflict with Prettier.
extends: [eslint.configs.recommended, googleStyle],
...eslintPluginPrettierRecommended,
},
{
languageOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
settings: {
// Allowlist some JSDoc tag aliases we use.
'jsdoc': {
'tagNamePreference': {
'return': 'return',
'fileoverview': 'fileoverview',
'extends': 'extends',
'constructor': 'constructor',
},
},
},
rules,
},
{
files: [
'packages/blockly/eslint.config.mjs',
Expand Down Expand Up @@ -353,9 +327,41 @@ export default defineConfig(
},
},
{
files: ['packages/plugins/theme-*/**'],
files: [
'packages/plugins/theme-*/**',
'packages/plugins/dev-tools/**'
],
languageOptions: {
globals: {
...globals.browser,
...globals.commonjs,
...globals.node,
...globals.es5,
Blockly: true,
goog: true,
monaco: true,
dat: true,
},
},
linterOptions: {
reportUnusedDisableDirectives: true,
},
plugins: {
jsdoc,
},
settings: {
jsdoc: {
tagNamePreference: {
returns: 'returns',
},
mode: 'closure',
},
},
rules: {
'no-invalid-this': 'off',
// http://eslint.org/docs/rules/
'camelcase': 'warn',
'new-cap': ['error', {capIsNewExceptionPattern: '^.*Error'}],
'no-invalid-this': 'off',
// valid-jsdoc does not work properly for interface methods.
// https://github.com/eslint/eslint/issues/9978
'valid-jsdoc': 'off',
Expand Down Expand Up @@ -396,6 +402,20 @@ export default defineConfig(
],
}
},
{
settings: {
// Allowlist some JSDoc tag aliases we use.
'jsdoc': {
'tagNamePreference': {
'return': 'return',
'fileoverview': 'fileoverview',
'extends': 'extends',
'constructor': 'constructor',
},
},
},
rules,
},
...tseslint.config(
buildTSOverride({
files: ['packages/blockly/**/*.ts', 'packages/blockly/**/*.tsx'],
Expand Down
Loading