  We propose a way to maintain strong consistency and facilitate error analysis
in the context of dissipation-based WENO stabilization for continuous and
discontinuous Galerkin discretizations of conservation laws. Following Kuzmin
and Vedral (J. Comput. Phys. 487:112153, 2023) and Vedral (arXiv preprint
arXiv:2309.12019), we use WENO shock detectors to determine appropriate amounts
of low-order artificial viscosity. In contrast to existing WENO methods, our
approach blends candidate polynomials using residual-based nonlinear weights.
The shock-capturing terms of our stabilized Galerkin methods vanish if
residuals do. This enables us to achieve improved accuracy compared to weakly
consistent alternatives. As we show in the context of steady
convection-diffusion-reaction (CDR) equations, nonlinear local projection
stabilization terms can be included in a way that preserves the coercivity of
local bilinear forms. For the corresponding Galerkin-WENO discretization of a
CDR problem, we rigorously derive a priori error estimates. Additionally, we
demonstrate the stability and accuracy of the proposed method through one- and
two-dimensional numerical experiments for hyperbolic conservation laws and
systems thereof. The numerical results for representative test problems are
superior to those obtained with traditional WENO schemes, particularly in
scenarios involving shocks and steep gradients.
